Possible Duplicate:
Inserting a Java string in another string without concatenation?
In Object C , the string formatting is like this
url = [NSString stringWithFormat:@"%@devices.json?user=%@&pswd=%@",server_name, user,password];
What about in Java for Android?
How does it handle that?
You can concatenate the strings or use String.format(String format, Object… args)
Concatenate
String url = server_name + “devices.json?user=” + user + “&pswd=” + password
Format
String url = String.format(“%sdevices.json?user=%spswd=%s”,server_name,user,password);
It is a matter of preference for which one you prefer.
Look up java.util.Formatter for a table that demonstrates other conversion types. %s is for string, %d for int …