Results 1 to 4 of 4
Thread: Quotes around variables
- 03-16-2011, 09:25 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 1
- Rep Power
- 0
-
Yes, it can be done, with Java formatter.
If the number is an integer, use %d e.g.
Java Code://note we use 'printf' to use the Java formatter System.out.printf("You have entered %d.",num);
Please read here for more info:
Formatting Numeric Print Output (The Java™ Tutorials > Learning the Java Language > Numbers and Strings)Last edited by ozzyman; 03-16-2011 at 09:35 PM.
- 03-16-2011, 09:40 PM #3
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
I don't see why you would want a formatted, he wants quotes around his number and that's all, no formatting needed.
@op: use the escaped quote.
Java Code:String s = "hi the number is\"" + num + "\".";
Last edited by sunde887; 03-16-2011 at 09:42 PM.
-
Similar Threads
-
String, quotes and args
By mac in forum New To JavaReplies: 8Last Post: 02-04-2010, 04:24 PM -
unbalanced quotes in -
By fresh83 in forum New To JavaReplies: 2Last Post: 12-19-2009, 01:10 AM -
Stock Quotes
By BartDR in forum Advanced JavaReplies: 0Last Post: 09-15-2009, 09:15 AM -
The Fav. Programming Quotes Thread
By angryboy in forum Forum LobbyReplies: 3Last Post: 06-13-2009, 10:16 AM -
Inserting data containing quotes into DB
By Java Tip in forum Java TipReplies: 0Last Post: 02-06-2008, 09:28 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks