About 375,000 results
Open links in new tab
  1. How to format strings in Java - Stack Overflow

    Primitive question, but how do I format strings like this: "Step {1} of {2}" by substituting variables using Java? In C# it's easy.

  2. java - Left padding a String with Zeros - Stack Overflow

    I've seen similar questions here and here. But am not getting how to left pad a String with Zero. input: "129018" output: "0000129018" The total output length should be TEN.

  3. java - How to including variables within strings? - Stack Overflow

    String string = String.format("A String %s %2d", aStringVar, anIntVar); I'm not sure if that is attractive enough for you, but it can be quite handy. The syntax is the same as for printf and …

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

  5. Convert java.util.Date to String - Stack Overflow

    I want to convert a java.util.Date object to a String in Java. The format is 2010-05-30 22:15:52

  6. How can I pad a String in Java? - Stack Overflow

    Dec 2, 2016 · Is there some easy way to pad Strings in Java? Seems like something that should be in some StringUtil-like API, but I can't find anything that does this.

  7. java - How to nicely format floating numbers to string without ...

    Apr 1, 2009 · How to nicely format floating numbers to string without unnecessary decimal 0's Asked 16 years, 8 months ago Modified 2 years, 10 months ago Viewed 871k times

  8. Change date format in a Java string - Stack Overflow

    Jan 18, 2011 · You need DateTimeFormatter only for parsing your string but you do not need a DateTimeFormatter to get the date in the desired format. The modern Date-Time API is based on …

  9. Is it better practice to use String.format over string Concatenation in ...

    May 29, 2009 · Is there a perceptible difference between using String.format and String concatenation in Java? I tend to use String.format but occasionally will slip and use a concatenation. I was wondering …

  10. java - How to convert date in to yyyy-MM-dd Format? - Stack Overflow

    Dec 1, 2012 · String formattedDate = date.format(DateTimeFormatter.ISO_LOCAL_DATE); ISO in the formatter name refers to the ISO 8601 standard. According to it a date is formatted the way you also …