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 ]