INT and String Multi-way methods of transitioning each other (transfer)

xiaoxiao2021-03-06  36

Author: jeru

Email: jeru@163.net

Date: 7/4/2001 3:49:44 PM

5.1 How to convert a string string into an integer int?

A. There are two ways:

1). INT i = integer.parseint ([string]); or

I = integer.parseint ([String], [INT RADIX]);

2). INT i = integer.valueof (my_str) .intValue ();

Note: The string is transformed into Double, Float, and long.

5.2 How to convert an integer Int into a string string?

A. Have a variety of methods:

String s = String.Valueof (i);

2.) String s = integer.tostring (i);

3.) String s = "" i;

Note: Double, Float, long-converted to string is similar.

转载请注明原文地址:https://www.9cbs.com/read-73210.html

New Post(0)