About 57 results
Open links in new tab
  1. How do I convert a String to an int in Java? - Stack Overflow

    Alternatively, you can use an Ints method from the Guava library, which in combination with Java 8's Optional, makes for a powerful and concise way to convert a string into an int:

  2. How can I convert String to Int? - Stack Overflow

    I have a TextBoxD1.Text and I want to convert it to an int to store it in a database. How can I do this?

  3. How do I parse a string to a float or int? - Stack Overflow

    Dec 19, 2008 · For the reverse, see Convert integer to string in Python and Converting a float to a string without rounding it. Please instead use How can I read inputs as numbers? to close duplicate …

  4. How can I convert a std::string to int? - Stack Overflow

    Nov 20, 2014 · To convert from string representation to integer value, we can use std::stringstream. if the value converted is out of range for integer data type, it returns INT_MIN or INT_MAX.

  5. .net - How to convert string to integer in C# - Stack Overflow

    Feb 26, 2010 · int.TryParse is safer since if you put something else in varString (for example "fsfdsfs") you would get an exception. By using int.TryParse when string can't be converted into int it will return 0.

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

    Nov 5, 2010 · 1. You ask for the empty string; 2. You ask for concatenation; 3. as you do not have a string, you will finally convert your int into string. The solution of daridoo avoid the first steps.

  7. 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 …

  8. Convert all strings in a list to integers - Stack Overflow

    Here, append () is used to add items ( i.e integer version of string (i) in this program ) to the end of the list (b). Note: int () is a function that helps to convert an integer in the form of string, back to its …

  9. How can I convert a string to an int in Python? - Stack Overflow

    def convertStr(s): """Convert string to either int or float.""" try: ret = int(s) except ValueError: #Try float. ret = float(s) return ret That way if the int conversion doesn't work, you'll get a float returned. Edit: …

  10. How can I convert int to string in C++? - Stack Overflow

    Second, it now checks the result, so (for example) if you convert from a string to an int, it can throw an exception if the string contains something that couldn't be converted to an int (e.g., 1234 would …