Char.ConvertFromUtf32(Int32) Method in C#


The Char.ConvertFromUtf32(Int32) method in C# is used to converts the specified Unicode code point into a UTF-16 encoded string.

Syntax

Following is the syntax −

public static string ConvertFromUtf32 (int utf32);

Above, the parameter utf32 is a 21-bit Unicode code point.

Example

Let us now see an example to implement the Char.ConvertFromUtf32(Int32) method −

using System; public class Demo {    public static void Main(){       int utf = 0x0051;       string str = Char.ConvertFromUtf32(utf);       Console.WriteLine("Value = "+str);    } }

Output

This will produce the following output −

Value = Q

Example

Let us now see another example −

using System;
public class Demo {
   public static void Main(){
      int utf = 0x0046;
      string str = Char.ConvertFromUtf32(utf);
      Console.WriteLine("Value = "+str);
   }
}

Output

This will produce the following output −

Value = F
raja
Published on 06-Nov-2019 06:17:46
Advertisements