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.
Function ReplaceStr1TOSTR2 (String str1, str3) {
// STR1 is the original string containing a string to be replaced
// STR2 is the string to be replaced
// STR3 is the STR3 replaced with Str2
Stringbuilder D = New StringBuilder (STR1);
D = D.Replace (STR2, STR3);
Return D.toTOString ();
}
script>
Then, we can handle the "'" symbol when the SQL statement is processed by ReplaceStr1TOSTR2 (Str, "'")! In addition
It is also possible to process the carriage return when the REPLACESTR1TOSTR2 (STR, "/ N", "
") is processed! ! !