指定形式字符串转化以及字符串编码转换

来源:互联网 发布:linux复制文件夹 编辑:程序博客网 时间:2024/06/06 02:27

Strings.StrConv 方法 

返回已转换为指定形式的字符串。

命名空间:Microsoft.VisualBasic

using Microsoft.VisualBasic;  //引用Microsoft.VisualBasic命名空间


程序集:Microsoft.VisualBasic.Runtime(在 microsoft.visualbasic.dll 中)

VbStrConv枚举类型

枚举成员

VbStrConv.None        不执行任何转换

VbStrConv.LinguisticCasing        使用语言规则进行大小写,而不使用文件系统(默认)。仅当与VbStrConv.UpperCaseVbStrConv.LowerCase 一起使用时才有效。

VbStrConv.UpperCase         将字符串转换为大写字符。

VbStrConv.LowerCase          将字符串转换为小写字符。

VbStrConv.ProperCase      将字符串中每个单词的第一个字母转换为大写。

VbStrConv.Wide *      将字符串中的窄(半角)字符转换为宽(全角)字符。

VbStrConv.Narrow *    将字符串中的宽(全角)字符转换为窄(半角)字符。

VbStrConv.Katakana **    将字符串中的平假名字符转换为片假名字符。

VbStrConv.Hiragana **    将字符串中的片假名字符转换为平假名字符。

VbStrConv.SimplifiedChinese *   将繁体中文字符转换为简体中文字符。

VbStrConv.TraditionalChinese *   将简体中文字符转换为繁体中文字符。


使用示例:


繁体转为简体

strings.strconv(srcstr,VbStrConv.SimplifiedChinese) ' localdid 未指定


简体转为繁体

strings.strconv(srcstr,VbStrConv.TraditionalChinese) ' localdid 未指定



原创粉丝点击