If you’re using Java 5 or higher, you can use String.format
:
urlString += String.format("u1=%s;u2=%s;u3=%s;u4=%s;", u1, u2, u3, u4);
See Formatter
for details.
More Related Contents:
- Java generating Strings with placeholders
- I'm trying to create a basic android application on eclipse [closed]
- Java number of results generated
- Java: What modifier makes the object readable outside the class, but not writable?
- How to launch an Activity from another Application in Android
- Array or List in Java. Which is faster?
- How do I check if the user is pressing a key?
- How can I calculate a time difference in Java?
- Fastest way to write huge data in text file Java
- How to create AST with ANTLR4?
- Most efficient way to increment a Map value in Java
- Is JDK “upward” or “backward” compatible?
- How to format LocalDate object to MM/dd/yyyy and have format persist
- How to enumerate IP addresses of all enabled NIC cards from Java?
- New Integer vs valueOf
- How does Java order items in a HashMap or a HashTable?
- Broadcast Receiver as inner class in Android
- Correct way to synchronize ArrayList in java
- How to add button in JavaFX table view
- Why is this Java code in curly braces ({}) outside of a method?
- How can I measure/calculate the size a Document needs to render itself?
- Multipart File Upload on Google Appengine using jersey-1.7
- How to set SameSite and Secure attribute to JSESSIONID cookie
- Does an instance of superclass get created when we instantiate an object?
- Javadoc @author tag good practices
- Printing with Attributes(Tray Control, Duplex, etc…) using javax.print library
- How to keep the order of elements in hashtable
- Why subclass in another package cannot access a protected method?
- struts2 file upload loosing parameters
- Unserialize in Java a serialized php object