C # calling VB to make simple and complicated conversion method

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.