निर्दिष्ट स्ट्रिंग के मान को उसके समकक्ष यूनिकोड वर्ण में बदलने के लिए, कोड इस प्रकार है -
उदाहरण
using System;
public class Demo {
public static void Main(){
bool res;
Char ch;
res = Char.TryParse("10", out ch);
Console.WriteLine(res);
Console.WriteLine(ch.ToString());
}
} आउटपुट
यह निम्नलिखित आउटपुट देगा -
False
उदाहरण
आइए अब एक और उदाहरण देखें -
using System;
public class Demo {
public static void Main(){
bool res;
Char ch;
res = Char.TryParse("P", out ch);
Console.WriteLine(res);
Console.WriteLine(ch.ToString());
}
} आउटपुट
यह निम्नलिखित आउटपुट देगा -
True P