Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java turn string into int

//parsing string to int
String numberToParse = "420";
int number = 0;

try{
  	number = Integer.parseInt(numberToParse);
}catch(NumberFormatException e){
	//the string cannot be parsed into a number
  	//ex Integer.parseInt("d15");
  	e.printStackTrace();
}

System.out.println(number);
Source by talentify.com #
 
PREVIOUS NEXT
Tagged: #java #turn #string #int
ADD COMMENT
Topic
Name
8+5 =