Click here to Skip to main content
16,005,491 members
Home / Discussions / C#
   

C#

 
QuestionCount Words in a string Pin
kevinwell17-Mar-10 3:16
kevinwell17-Mar-10 3:16 
AnswerRe: Count Words in a string Pin
PIEBALDconsult17-Mar-10 3:27
mvePIEBALDconsult17-Mar-10 3:27 
AnswerRe: Count Words in a string Pin
OriginalGriff17-Mar-10 3:41
mveOriginalGriff17-Mar-10 3:41 
AnswerRe: Count Words in a string Pin
Mirko198017-Mar-10 3:52
Mirko198017-Mar-10 3:52 
GeneralRe: Count Words in a string Pin
OriginalGriff17-Mar-10 4:01
mveOriginalGriff17-Mar-10 4:01 
GeneralRe: Count Words in a string Pin
Luc Pattyn17-Mar-10 5:14
sitebuilderLuc Pattyn17-Mar-10 5:14 
GeneralRe: Count Words in a string Pin
Som Shekhar17-Mar-10 6:43
Som Shekhar17-Mar-10 6:43 
AnswerRe: Count Words in a string Pin
#realJSOP17-Mar-10 7:31
professional#realJSOP17-Mar-10 7:31 
kevinwell wrote:
It works with the splitfunction. But can anyone help me with this becaus I don't want you use the split function.


Smells like homework to me. You only get these kinds of requirements when an instructor hands out assignments.

In any case, since you seem incapable of figuring this out on your own...

Just iterate through each character of the string, and wehenever you encounter a space (or a tab), increment a counter. At the end of the loop, add 1 to the counter, and that's how many words are in your string.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

GeneralRe: Count Words in a string Pin
AspDotNetDev17-Mar-10 20:04
protectorAspDotNetDev17-Mar-10 20:04 
QuestionC# Form Application - WebBrowserControl - DocumentComplete issue Pin
Jon Braunsma17-Mar-10 2:42
Jon Braunsma17-Mar-10 2:42 
AnswerRe: C# Form Application - WebBrowserControl - DocumentComplete issue Pin
Dave Kreskowiak17-Mar-10 3:22
mveDave Kreskowiak17-Mar-10 3:22 
GeneralRe: C# Form Application - WebBrowserControl - DocumentComplete issue Pin
Jon Braunsma17-Mar-10 10:46
Jon Braunsma17-Mar-10 10:46 
GeneralRe: C# Form Application - WebBrowserControl - DocumentComplete issue Pin
Dave Kreskowiak17-Mar-10 12:33
mveDave Kreskowiak17-Mar-10 12:33 
AnswerRe: C# Form Application - WebBrowserControl - DocumentComplete issue Pin
#realJSOP17-Mar-10 7:34
professional#realJSOP17-Mar-10 7:34 
AnswerRe: C# Form Application - WebBrowserControl - DocumentComplete issue Pin
Luc Pattyn17-Mar-10 8:02
sitebuilderLuc Pattyn17-Mar-10 8:02 
GeneralRe: C# Form Application - WebBrowserControl - DocumentComplete issue Pin
Jon Braunsma17-Mar-10 10:48
Jon Braunsma17-Mar-10 10:48 
AnswerRe: C# Form Application - WebBrowserControl - DocumentComplete issue Pin
Jon Braunsma18-Mar-10 7:37
Jon Braunsma18-Mar-10 7:37 
Questionnot able to see controls on form its get hide automatically Pin
sn001117-Mar-10 1:55
sn001117-Mar-10 1:55 
AnswerRe: not able to see controls on form its get hide automatically Pin
sanforjackass17-Mar-10 2:06
sanforjackass17-Mar-10 2:06 
GeneralRe: not able to see controls on form its get hide automatically Pin
sn001117-Mar-10 2:36
sn001117-Mar-10 2:36 
GeneralRe: not able to see controls on form its get hide automatically Pin
#realJSOP17-Mar-10 2:39
professional#realJSOP17-Mar-10 2:39 
GeneralRe: not able to see controls on form its get hide automatically Pin
Dave Kreskowiak17-Mar-10 3:19
mveDave Kreskowiak17-Mar-10 3:19 
QuestionProblem in Datagridview with multiple combobox windows c# Pin
Member 441328317-Mar-10 1:33
Member 441328317-Mar-10 1:33 
QuestionNetMeeting using C# Pin
v_neil8717-Mar-10 1:26
v_neil8717-Mar-10 1:26 
AnswerRe: NetMeeting using C# Pin
Greg Chelstowski17-Mar-10 1:35
Greg Chelstowski17-Mar-10 1:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.