This paper describes the method of C # calling VB to simplify the transformation. Share to everyone for your reference. The specific analysis is as follows:
First, refer to the Microsoft.VisualBasic.dll in the C # project, the version chooses the appropriate
Then add references in the project: using Microsoft.VisualBasic;
Transformation:
Convert to Traditional:
Outputtext=strings.strconv (txt to convert text, VbStrConv.TraditionalChinese);
Convert to Simplified:
Outputtext=strings.strconv (txt to convert text, VbStrConv.SimplifiedChinese);
In addition, full-width and half-width conversion, hiragana and Katakana conversions are also possible:
Turn Full angle:
Outputtext=strings.strconv (txt to convert text, vbstrconv.wide);
Turn Half angle:
Outputtext=strings.strconv (txt to convert text, vbstrconv.narrow);
Strings also contains some methods not found in C #, such as Ltrim,rtrim, etc.
I hope this article is helpful to everyone's C # programming.
In addition to the Declaration,
Running GuestArticles are original, reproduced please link to the form of the address of this article
C # calling VB to make simple and complicated conversion method
This address: http://www.paobuke.com/develop/c-develop/pbk23138.html
Related content C # implementation file upload download Excel document Sample code use C # Regular expression validation Chinese characters (instance code) C # sqlhelper Application Development Learning easy to learn C # string class
C # How to read data from a database to a dataset and save to an XML file C # implement software to monitor the running state of external programs C # IDisposable pattern usage in detail C #. NET Implements currency conversion example
C # calling VB to make simple and complicated conversion method