• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

VB.NET Char.GetNumericValue方法代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了VB.NET中System.Char.GetNumericValue方法的典型用法代码示例。如果您正苦于以下问题:VB.NET Char.GetNumericValue方法的具体用法?VB.NET Char.GetNumericValue怎么用?VB.NET Char.GetNumericValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Char的用法示例。



在下文中一共展示了Char.GetNumericValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的VB.NET代码示例。

示例1: GetNumericValueSample

Module GetNumericValueSample
    Sub Main()
        Dim str As String
        str = "input: 1"

        Console.WriteLine(Char.GetNumericValue("8"c))       ' Output: "8"
        Console.WriteLine(Char.GetNumericValue(str, 7))     ' Output: "1"
    End Sub
End Module
开发者ID:VB.NET开发者,项目名称:System,代码行数:9,代码来源:Char.GetNumericValue


示例2:

' Define a UTF32 value for each character in the 
' Aegean numbering system.
For utf32 As Integer = &h10107 To &h10133
   Dim surrogate As String = Char.ConvertFromUtf32(utf32)
   For ctr As Integer = 0 To surrogate.Length - 1
      Console.Write("U+{0:X4} at position {1}: {2}     ", 
                        Convert.ToUInt16(surrogate(ctr)), ctr,  
                        Char.GetNumericValue(surrogate, ctr))
   Next
   Console.WriteLine()
Next
开发者ID:VB.NET开发者,项目名称:System,代码行数:11,代码来源:Char.GetNumericValue

输出:

U+D800 at position 0: 1     U+DD07 at position 1: -1
U+D800 at position 0: 2     U+DD08 at position 1: -1
U+D800 at position 0: 3     U+DD09 at position 1: -1
U+D800 at position 0: 4     U+DD0A at position 1: -1
U+D800 at position 0: 5     U+DD0B at position 1: -1
U+D800 at position 0: 6     U+DD0C at position 1: -1
U+D800 at position 0: 7     U+DD0D at position 1: -1
U+D800 at position 0: 8     U+DD0E at position 1: -1
U+D800 at position 0: 9     U+DD0F at position 1: -1
U+D800 at position 0: 10     U+DD10 at position 1: -1
U+D800 at position 0: 20     U+DD11 at position 1: -1
U+D800 at position 0: 30     U+DD12 at position 1: -1
U+D800 at position 0: 40     U+DD13 at position 1: -1
U+D800 at position 0: 50     U+DD14 at position 1: -1
U+D800 at position 0: 60     U+DD15 at position 1: -1
U+D800 at position 0: 70     U+DD16 at position 1: -1
U+D800 at position 0: 80     U+DD17 at position 1: -1
U+D800 at position 0: 90     U+DD18 at position 1: -1
U+D800 at position 0: 100     U+DD19 at position 1: -1
U+D800 at position 0: 200     U+DD1A at position 1: -1
U+D800 at position 0: 300     U+DD1B at position 1: -1
U+D800 at position 0: 400     U+DD1C at position 1: -1
U+D800 at position 0: 500     U+DD1D at position 1: -1
U+D800 at position 0: 600     U+DD1E at position 1: -1
U+D800 at position 0: 700     U+DD1F at position 1: -1
U+D800 at position 0: 800     U+DD20 at position 1: -1
U+D800 at position 0: 900     U+DD21 at position 1: -1
U+D800 at position 0: 1000     U+DD22 at position 1: -1
U+D800 at position 0: 2000     U+DD23 at position 1: -1
U+D800 at position 0: 3000     U+DD24 at position 1: -1
U+D800 at position 0: 4000     U+DD25 at position 1: -1
U+D800 at position 0: 5000     U+DD26 at position 1: -1
U+D800 at position 0: 6000     U+DD27 at position 1: -1
U+D800 at position 0: 7000     U+DD28 at position 1: -1
U+D800 at position 0: 8000     U+DD29 at position 1: -1
U+D800 at position 0: 9000     U+DD2A at position 1: -1
U+D800 at position 0: 10000     U+DD2B at position 1: -1
U+D800 at position 0: 20000     U+DD2C at position 1: -1
U+D800 at position 0: 30000     U+DD2D at position 1: -1
U+D800 at position 0: 40000     U+DD2E at position 1: -1
U+D800 at position 0: 50000     U+DD2F at position 1: -1
U+D800 at position 0: 60000     U+DD30 at position 1: -1
U+D800 at position 0: 70000     U+DD31 at position 1: -1
U+D800 at position 0: 80000     U+DD32 at position 1: -1
U+D800 at position 0: 90000     U+DD33 at position 1: -1


示例3:

Dim utf32 As Integer = &h10107       ' AEGEAN NUMBER ONE
Dim surrogate As String = Char.ConvertFromUtf32(utf32)
For Each ch In surrogate
   Console.WriteLine("U+{0:X4}: {1}    ", Convert.ToUInt16(ch), 
                                          Char.GetNumericValue(ch))
Next
开发者ID:VB.NET开发者,项目名称:System,代码行数:6,代码来源:Char.GetNumericValue

输出:

U+D800: -1
U+DD07: -1



注:本文中的System.Char.GetNumericValue方法示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
VB.NET Char.IsHighSurrogate方法代码示例发布时间:2022-05-24
下一篇:
VB.NET BitConverter.ToInt64方法代码示例发布时间:2022-05-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap