C # Full-width half-width conversion output Solution

Source: Internet
Author: User

Microsoft.VisualBasic namespace Strings module StrConv functions have uppercase/lowercase, full-width/half-width, Simplified Chinese/traditional conversion functions, String conversion should be said to be VB.net's strong point, is this: vb.net direct StrConv function is OK, C # version of the need to add a reference Microsoft.VisualBasic.dll in the project, and then you can in C # The StrConv function of vb.net is used directly in the program.

Adding reference Microsoft.VisualBasic.dll to a C # project, you can use the rich functions in vb.net 1//command-line compilation directly in a C # program: Csc/r:microsoft.visualbasic.dll Test.cs

If you are using the Visual Studio. NET IDE, add a reference to your project in the following ways:

Open [Solution Explorer], right-click the project name, select [Add Reference],

Select the Microsoft Visual Basic. NET Runtime component from the list.
Using Microsoft.VisualBasic;
Class Test
{
static void Main ()
{
string s = "blog Park-defifind";
System.Console.WriteLine (s);
s = Strings.strconv (s, vbstrconv.wide, 0); Half angle turn full angle
s = Strings.strconv (s, VbStrConv.TraditionalChinese, 0); Simplified to Traditional
System.Console.WriteLine (s);
s = Strings.strconv (s, vbstrconv.propercase, 0); Capitalize first letter
s = Strings.strconv (s, vbstrconv.narrow, 0); Full angle turning half angle
s = Strings.strconv (s, VbStrConv.SimplifiedChinese, 0); Traditional to Simplified
System.Console.WriteLine (s);
}

C # Full-width half-width conversion output Solution

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.