Difference between revisions of "scala:Convert a String to a Number"

From Progzoo
Jump to: navigation, search
 
Line 1: Line 1:
 
{{topTenTips}}
 
{{topTenTips}}
 
<question height="100" width="150" className="Demo" rows="9" cols="40" lang='scala'>  
 
<question height="100" width="150" className="Demo" rows="9" cols="40" lang='scala'>  
<code>toInt</code> is the static method that you need here.
+
<code>toInt</code> is the method that you need here.
You have access to all of the java.lang packages such as http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#parseInt(java.lang.String)
+
You also have access to all of the java.lang things such as [http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#parseInt(java.lang.String) java.lang.Integer.parseInt]
  
 
See also:
 
See also:

Latest revision as of 20:14, 16 February 2015

toInt is the method that you need here. You also have access to all of the java.lang things such as java.lang.Integer.parseInt

See also:

  • toDouble
  • toLong


[Font] [Default] [Show] [Resize] [History] [Profile]