.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

string length

Posted By: Rama Krishna     Posted Date: September 21, 2010    Points:2   Category :C#
i want to find the no of charactrs in a string without using builtin functions?

Responses
Author: Asha.MP             
Posted Date: September 21, 2010     Points: 5   

Hi..

Plese check below code.

string str = "Tumkur";
int len = 0;
foreach (char i in str)
{
len += 1;
}
Console.WriteLine(len);


Thanks and Regards,
Asha.mp
Author: Syed Shakeer Hussain             
Posted Date: September 21, 2010     Points: 5   

Hi,




String StringName="Hello";
int i=0;
foreach(string str in StringName)
{

i=i+1;

}

MessageBox.Show("length of string is"+i);











Author: Syed Shakeer Hussain             
Posted Date: September 21, 2010     Points: 5   

Hi,




String StringName="Hello";
int i=0;
foreach(string str in StringName)
{

i=i+1;

}

MessageBox.Show("length of string is"+i);











Author: Syed Shakeer Hussain             
Posted Date: September 21, 2010     Points: 5   

Hi,




String StringName="Hello";
int i=0;
foreach(string str in StringName)
{

i=i+1;

}

MessageBox.Show("length of string is"+i);













Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend