ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,508 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
VB code
How to get the Chinese from "Office办公室" this string ?
mystr is variables.
Sample:
mystr="Office办公室"
I want
me.Txt_Dept.Text="办公室"
Thank you.
Check a solution that uses Regular Expressions:
Dim mystr = "Office办公室"
Dim result = Regex.Replace(mystr, "[^\p{IsCJKUnifiedIdeographs}]+", " ").Trim
me.Txt_Dept.Text = result
The expression can be improved to keep more kinds of letters.
For example =>
Dim sString = "Office办公室"
Dim sResult As String = RegularExpressions.Regex.Replace(sString, "[\u4E00-\u9FA5]", "")