how to count the words in string with out using built in functions in c#
can u take string is a user entre and use this
string str=textbox1.text;
int i=
myOwnGetStringLength(str);
scriptmanager.startupscript(this,this.gettype(),"script","alert("+i+")",true);
int myOwnGetStringLength(String str)
{
int count = 0;
foreach(Char c in str)
count++;
return count;
}
in built in funtion
string str=textbox1.text;
int i=
str.length;
scriptmanager.startupscript(this,this.gettype(),"script","alert("+i+")",true);
Comments
Post a Comment