vinay kumar
How to select a character from a string? for example: string str = "Hello"; from the above string how to get the first letter into char c;
Posted by vinay kumar in OOP | Others on Jun 23, 2010
0
Do you know the answer for this question? Post it below.
Guest

string str = "Hello";
char[] n;

 n = str.ToCharArray();
 Response.Write(n[0]);

Posted by JASPAL on Apr 03, 2012

hello,Hirendra Sisodiya
Char C=str.SubString(0,1).tostring()
As you told this solution. can You please explain me wt does (0,1) means in above code?

Posted by kanchan setia on Feb 03, 2011

c = str.charAt(0)

Posted by Phuc Nguyen on Dec 20, 2010

private char GetChar(string myString, char myChar)

{

   return convert.toChar(myString.Substring(myString.IndexOf(myChar),myString.IndexOf(myChar)));

}

by calling this funtion you will get the expected character from string

Posted by Uday Gaikwad on Aug 25, 2010

Hi Vinay,
As you ask about the string related problem, just read this article, i hope this article help you. Click hear...

Posted by Manish Tewatia on Aug 12, 2010
Sponsored by
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Sponsored by
Team Foundation Server Hosting
Become a Sponsor
PRIVACY POLICY | TERMS & CONDITIONS | SITEMAP | CONTACT US | REPORT ABUSE © 2011 C# Corner. All contents are copyright of their authors.