|
Imports System.Text
'全型轉半型 Public Function ToNchr(ByRef data As String) As String Dim sb As New StringBuilder Dim ascii As Integer = 0
For Each c As Char In data.Replace("〔", "[").Replace("〕", "]").Replace("'", "'").ToCharArray() ascii = System.Convert.ToInt32(c) If ascii = 12288 Then sb.Append(System.Convert.ToChar(32)) Else If ascii > 65280 And ascii < 65375 Then sb.Append(System.Convert.ToChar(ascii - 65248)) Else sb.Append(System.Convert.ToChar(ascii)) End If End If Next
Return sb.ToString End Function |
- Oct 08 Tue 2013 10:56
-
[VB.Net][全型轉半型不含中文字]
請先 登入 以發表留言。