string str = "Hello";
char[] n;
n = str.ToCharArray();
Response.Write(n[0]);
Interviews6 answers
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
Most programming languages are very rich in string operation..
if we talk about VB.NET, we can use substring function like this
Char C=str.SubString(0,1).tostring()
thanks
Answer an interview question and earn +10 SHARP for every answer.
See unanswered questions