Horje
words counter c# Code Example
words counter c#
int count = inputstring.Split(' ').Length;
words counter c#

int wordCount = 0, index = 0;

// skip whitespace until first word
while (index < text.Length && char.IsWhiteSpace(text[index]))
    index++;

while (index < text.Length)
{
    // check if current char is part of a word
    while (index < text.Length && !char.IsWhiteSpace(text[index]))
        index++;

    wordCount++;

    // skip whitespace until next word
    while (index < text.Length && char.IsWhiteSpace(text[index]))
        index++;
}





Csharp

Related
how to write a variable in console c# Code Example how to write a variable in console c# Code Example
how to get element dictionary key in c# by index Code Example how to get element dictionary key in c# by index Code Example
c# string replace with empty char Code Example c# string replace with empty char Code Example
c# unity detect any keyboard input Code Example c# unity detect any keyboard input Code Example
new color unity Code Example new color unity Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12