Switch to full style
General Java code examples
Post a reply

get number from string

Tue Apr 23, 2013 9:20 pm

Convert String into Integer
java code
/**
* @param strNumber number as String type.
* @return number as Integer type.
*/
private int getNumber(final String strNumber)
{
int number;
try
{
number = Integer.parseInt(strNumber);
} catch (NumberFormatException exception) {
exception.printStackTrace();
return -1;
}
return number;


}




Post a reply
  Related Posts  to : get number from string
 get number of words in a string     -  
 Number of Occurrences of characters in a string     -  
 convert integer number to octal,hexadecimal number systems     -  
 convert octal number to decimal number     -  
 convert decimal number to octal number     -  
 check if string ends with specific sub-string in php     -  
 check if string start with a specific sub-string in PHP     -  
 Splitting a String Based on a Found String     -  
 recursive string reversal- reverse string     -  
 String token for string split     -  

Topic Tags

Java Strings