C calls VB's method for simple and complex transformations
- 2020-12-21 18:08:57
- OfStack
This article illustrates how C# calls VB for simple and complex transformations. Share to everybody for everybody reference. The specific analysis is as follows:
Start by referring to Microsoft.VisualBasic.dll in the C# project, with the version chosen as appropriate
Then add a reference to the project: using Microsoft.VisualBasic;
Translation:
Turn into traditional:
outputText=Strings.StrConv(txt Text to be converted , VbStrConv.TraditionalChinese);
To simplified:
outputText=Strings.StrConv(txt Text to be converted , VbStrConv.SimplifiedChinese);
In addition, full-angle and half-angle conversion, hiragana and Katakana conversion, etc. :
Turn the Angle:
outputText=Strings.StrConv(txt Text to be converted , VbStrConv.Wide);
Turn half Angle:
outputText=Strings.StrConv(txt Text to be converted , VbStrConv.Narrow);
Strings also includes methods that are not available in C#, such as Ltrim,Rtrim, and so on
Hopefully this article has helped you with your C# programming.