Char.IsLowSurrogate() IsHighSurrogate() and IsSurrogatePair() : Char « Data Types « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Development
8.Event
9.File Directory
10.Generics
11.GUI
12.Language Basics
13.LINQ
14.Network Remote
15.Security
16.Thread
17.Windows Presentation Foundation
18.Windows System
19.XML
20.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Data Types » CharScreenshots 
Char.IsLowSurrogate() IsHighSurrogate() and IsSurrogatePair()
  

Imports System
Imports Microsoft.VisualBasic

Class Sample
   Public Shared Sub Main()
      Dim cHigh As Char = ChrW(&HD800)

      Dim cLow  As Char = ChrW(&HDC00)
      Dim s1 = New [String](New Char() {"a"c, ChrW(&HD800), ChrW(&HDC00)"z"c})

      Console.WriteLine("{0:X4}", AscW(cHigh))
      Console.WriteLine("{0:X4}", AscW(cLow))
      Dim As Integer
      For i = To s1.Length - 1
         Console.WriteLine("s1({0}) = {1:X4} ", i, AscW(s1.Chars(i)))
      Next i

      Console.WriteLine([Char].IsHighSurrogate(cLow))
      Console.WriteLine([Char].IsHighSurrogate(cHigh))
      Console.WriteLine([Char].IsHighSurrogate(s1, 0))
      Console.WriteLine([Char].IsHighSurrogate(s1, 1))

      Console.WriteLine([Char].IsLowSurrogate(cLow))
      Console.WriteLine([Char].IsLowSurrogate(cHigh))
      Console.WriteLine([Char].IsLowSurrogate(s1, 0))
      Console.WriteLine([Char].IsLowSurrogate(s1, 2))

      Console.WriteLine([Char].IsSurrogatePair(cHigh, cLow))
      Console.WriteLine([Char].IsSurrogatePair(s1, 0))
      Console.WriteLine([Char].IsSurrogatePair(s1, 1))
      Console.WriteLine([Char].IsSurrogatePair(s1, 2))

   End Sub
End Class

   
    
  
Related examples in the same category
1.Four ways to declare CharactersFour ways to declare Characters
2.Create a Console Line by Repeating a CharCreate a Console Line by Repeating a Char
3.Display contents of charArrayDisplay contents of charArray
4.Char IsDigitChar IsDigit
5.Char IsLetterChar IsLetter
6.Char IsLetterOrDigitChar IsLetterOrDigit
7.Char IsLowerChar IsLower
8.Char IsUpperChar IsUpper
9.Char ToUpperChar ToUpper
10.Char ToLowerChar ToLower
11.Char IsPunctuationChar IsPunctuation
12.Char IsSymbolChar IsSymbol
13.Insert char to StringBuilder
14.Generic and nongeneric versions of the CompareTo method for Char value
15.Char ToString.
16.Char.IsDigitChar.IsDigit
17.demonstrates IsSymbol
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.