Conversion between the data type of C # operation skills

zhaozj2021-02-11  208

http://www.asp888.net tofu technology station

The conversion between the data types in VB is very easy to CSTR, CINT, etc., we have already used it.

It's very clear, now you can use C # to do web applications! In this way, we have a choice of language, plus there's really a lot of people.

VB programming has a lot of not understanding: (, so they prefer C # to program, and there are also many comrades that are not determined! I also want to learn to learn C #

Language (such as: tofu ..), so, data conversion is expected! In addition, there is a conversion to String data types.

First let's take a look at the conversion between int and String

INT-> String, use the toString function, let's take a look at this example 1.tostring (), old day, such syntax can pass the identification :)

This is the C # language

String-> Int has a lot of choices (actually one), such as "12345" .toint16 (), function, of course, to TOINT32, TOINT64, etc.

Similar functions, usage is the same

How to convert String into an array type according to the specified rule, "http://www.asp888.net tofu technology station" .split ("" .tochararay ())

How to convert the specified String into additional string in a String, for example: "'" is converted into "' '"

We need to introduce a new Class StringBuilder here, let's take a look at this function.