public int countWords(string s1)
{
int cnt = 0;
//char space = ' ';
int i = 0;
for (i = 0; i < s1.Length; i++)
{
if (s1[i] == ' '){}
else if (s1[i] != ' ' && i == 0) cnt++;
else if (s1[i] != ' ' && s1[i - 1] != ' ') { }
else if (s1[i] != ' ' && s1[i - 1] == ' ') cnt++;
}
return cnt;
}
Subscribe to:
Post Comments (Atom)
-
All WMI Class Names list : - Name ...
-
$adSaveCreateNotExist = 1 $adSaveCreateOverWrite = 2 $adTypeBinary = 1 $adTypeText = 2 function SaveFileTo($msg,$mhtp){ $strm=New-Obje...
-
url: https://www.youtube.com/watch?v=Tq4w5qfCjko&ab_channel=C%23Guy Entity Framework Core 3.0 and Rest API, how to, tutorial #dotnetc...
No comments:
Post a Comment