Number-string 형 변환

number to string
str

1 Java[ | ]

int i = 42;
String str = String.valueOf(i);
int i = 42;
String str = Integer.toString(i);
int i = 42;
String str = "" + i;
long number = -1234578901234567890L;
String str = String.valueOf(number);
long number = -1234578901234567890L;
String str = new Long(number).toString();

2 PHP[ | ]

$num = 42;
$str = "$num";
var_dump($num);
var_dump($str);
# int(42)
# string(2) "42"

3 Python[ | ]

num = 42
mystr = str(num)
print( type(num) )
print( type(mystr) )
# <type 'int'>
# <type 'str'>

4 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}