About 50 results
Open links in new tab
  1. Java - Convert integer to string - Stack Overflow

    Returns a String object representing the specified integer. The argument is converted to signed decimal representation and returned as a string, exactly as if the argument and radix 10 were given as …

  2. How do I convert a String to an int in Java? - Stack Overflow

    Integer x = Integer.valueOf(str); // or int y = Integer.parseInt(str); There is a slight difference between these methods: valueOf returns a new or cached instance of java.lang.Integer parseInt returns …

  3. java - How do I convert from int to String? - Stack Overflow

    Nov 5, 2010 · If you say ""+i, Java creates a StringBuilder object, appends an empty string to it, converts the integer to a string, appends this to the StringBuilder, then converts the StringBuilder to a String.

  4. java - Integer to String conversion methods - Stack Overflow

    Sep 27, 2010 · What are the alternative methods for converting and integer to a string?

  5. Most efficient way of converting String to Integer in java

    Jun 23, 2009 · There are many ways of converting a String to an Integer object. Which is the most efficient among the below: Integer.valueOf() Integer.parseInt() …

  6. Get int from String, also containing letters, in Java

    Feb 26, 2010 · How can I get the int value from a string such as 423e - i.e. a string that contains a number but also maybe a letter? Integer.parseInt() fails since the string must be entirely a number.

  7. What's the best way to check if a String represents an integer in Java ...

    May 7, 2015 · If you are concerned whether you can actually parse the string into an int or long you would also need to check if the integer the string represents actually fits into those data types.

  8. Converting an int to a binary string representation in Java?

    Mar 9, 2010 · 45 There is also the java.lang.Integer.toString (int i, int base) method, which would be more appropriate if your code might one day handle bases other than 2 (binary). Keep in mind that …

  9. Determine if a String is an Integer in Java - Stack Overflow

    Mar 26, 2011 · I'm trying to determine if a particular item in an Array of strings is an integer or not. I am .split(" ") 'ing an infix expression in String form, and then trying to split the resultant array into two …

  10. Format an Integer using Java String Format - Stack Overflow

    I am wondering if it is possible, using the String.format method in Java, to give an integer preceding zeros? For example: 1 would become 001 2 would become 002 ... 11 would become 011 12 would b...