ForNext
Only Do What Only You Can Do
040. string to number
Hyperpolyglot C++ Style Languages: C++, Objective C, Java, C# より (2012.05.08)
VBScript
JScript
Perl
PHP
Python
Ruby
PowerShell
Scala
F#
C
C++
#include <sstream> stringstream ss("7 14.3 12"); int i; double d; long l; ss >> i >> d >> l;
C++Builder
VC++
C#
byte.Parse("14") short.Parse("14") int.Parse("14") long.Parse("14") float.Parse("14") double.Parse("14") decimal.Parse("14")
Java
Byte.parseByte("14") Short.parseShort("14") Integer.parseInt("14") Long.parseLong("14") Float.parseFloat("14.7") Double.parseDouble("14.7")
Objective-C
[@"14" integerValue] [@"14" longLongvalue] [@"14.7" floatValue] [@"14.7" doubleValue]