473,396 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

word length occurance in a text..

Write the code in best possible way c# for giving out put the maximum
number of time the same word length occurs.the text might contain . ,
to seperate word too..

Eg INPUT TEXT : "This text is test sample.Text lenght that occurs
maximum time.

OUT PUT : Word with length :4 Maximum occured :6

Sep 26 '06 #1
4 1233
What is it that you need help with? Do you have problem understanding
your school assignmnet?
am*********@gmail.com wrote:
Write the code in best possible way c# for giving out put the maximum
number of time the same word length occurs.the text might contain . ,
to seperate word too..

Eg INPUT TEXT : "This text is test sample.Text lenght that occurs
maximum time.

OUT PUT : Word with length :4 Maximum occured :6
Sep 27 '06 #2
It is nothing as such i have solved the problem asked in interview but
i wud like the best way as i feel i have unessary used lot of loops to
find the result

Göran Andersson wrote:
What is it that you need help with? Do you have problem understanding
your school assignmnet?
am*********@gmail.com wrote:
Write the code in best possible way c# for giving out put the maximum
number of time the same word length occurs.the text might contain . ,
to seperate word too..

Eg INPUT TEXT : "This text is test sample.Text lenght that occurs
maximum time.

OUT PUT : Word with length :4 Maximum occured :6
Sep 27 '06 #3
Amit,

We try not to give C# samples in this newsgroup.
Try for that the newsgroup

microsoft.dotnet.languages.csharp

Cor

<am*********@gmail.comschreef in bericht
news:11*********************@e3g2000cwe.googlegrou ps.com...
It is nothing as such i have solved the problem asked in interview but
i wud like the best way as i feel i have unessary used lot of loops to
find the result

Göran Andersson wrote:
What is it that you need help with? Do you have problem understanding
your school assignmnet?
am*********@gmail.com wrote:
Write the code in best possible way c# for giving out put the maximum
number of time the same word length occurs.the text might contain . ,
to seperate word too..

Eg INPUT TEXT : "This text is test sample.Text lenght that occurs
maximum time.

OUT PUT : Word with length :4 Maximum occured :6

Sep 28 '06 #4
It would be an interresting task to accomplish it without any loops at
all. I think that it can be done using a sorted dictionary, a regular
expression and a custom match evaluator.

Trying...

Well, what do you know... The dictionary isn't needed at all, so it can
be done with just a regular expression and a custom match evaluator. :)
am*********@gmail.com wrote:
It is nothing as such i have solved the problem asked in interview but
i wud like the best way as i feel i have unessary used lot of loops to
find the result

Göran Andersson wrote:
>What is it that you need help with? Do you have problem understanding
your school assignmnet?
am*********@gmail.com wrote:
>>Write the code in best possible way c# for giving out put the maximum
number of time the same word length occurs.the text might contain . ,
to seperate word too..

Eg INPUT TEXT : "This text is test sample.Text lenght that occurs
maximum time.

OUT PUT : Word with length :4 Maximum occured :6
Sep 28 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Alistair | last post by:
Hello folks... this is my first post in here. I'm new to ASP having done all my previous work in Flash and bog standard HTML. Only been learning for a couple of weeks. anyway...I have been...
7
by: news.hku.hk | last post by:
how to count the occurance of a character in a string ? e.g. #include <iostream> #include <string> using namespace std; int main (){ string text = "abc, def, ghi, jkl, mno"; // how to count...
9
by: Steven Bethard | last post by:
I've got a list of word substrings (the "tokens") which I need to align to a string of text (the "sentence"). The sentence is basically the concatenation of the token list, with spaces sometimes...
2
by: David | last post by:
Hi, Could PHP be used to take a txt file (or set of txt files) and add a string of characters every X number of words or characters? Say a txt file with 50,000 characters/5,000 words how would...
1
by: vmoreau | last post by:
I have a text and I need to find a Word that are not enclosed in paranthesis. Can it be done with a regex? Is someone could help me? I am not familar with regex... Example looking for WORD:...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
75
by: ume$h | last post by:
/* I wrote the following program to calculate no. of 'a' in the file c:/1.txt but it fails to give appropriate result. What is wrong with it? */ #include"stdio.h" int main(void) { FILE *f;...
0
by: akshar108 via DotNetMonster.com | last post by:
Hi, I have aspose slide component and i want to take all string in the presentation's all slide but that component not give any method to get that direct we have to take all shape's textframe...
3
by: waynejr25 | last post by:
can anyone help me add a function that will count the occurance of each word in an input file. here's the code i have so far it counts the number of characters, words, and lines but i need the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.