C # directly calls the VB. NET function, and converts the halfwidth and fullwidth and simplified and Traditional Chinese

Source: Internet
Author: User
Add a reference to Microsoft. VisualBasic. dll in the C # project # Program Directly use the rich functions in VB. NET

1 // Command Line Compilation: CSC/R: Microsoft. VisualBasic. dll test. CS
2
3 // If Visual Studio. net ide is used, add references to the project as follows:
4 // Open [Solution Explorer], right-click the project name, and select [add reference].
5 // Select the Microsoft Visual Basic. Net runtime component from the list.
6
7 Using Microsoft. VisualBasic;
8
9 Class Test
10 {
11 Static   Void Main ()
12 {
13 String S =   " Blog Park-Air Force [skyiv.cnblogs.com] " ;
14 System. Console. writeline (s );
15 S = Strings. strconv (S, vbstrconv. Wide, 0 ); // Halfwidth to fullwidth
16 S = Strings. strconv (S, vbstrconv. traditionalchinese, 0 ); // Simplified to traditional Chinese
17 System. Console. writeline (s );
18 S = Strings. strconv (S, vbstrconv. propercase, 0 ); // Uppercase letters
19 S = Strings. strconv (S, vbstrconv. Narrow, 0 ); // Fullwidth to halfwidth
20 S = Strings. strconv (S, vbstrconv. simplifiedchinese, 0 ); // Traditional to simplified
21 System. Console. writeline (s );
22 }
23 }

Program output:

Blog Park-Air Force [ Skyiv.cnblogs.com ]
Blog website-empty website [skyiv.cnblogs.com]
Blog Park-Air Force [ Skyiv. cnblogs. com ]

Related Article

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.