Results 1 to 9 of 9
- 05-20-2007, 08:58 PM #1
Member
- Join Date
- May 2007
- Posts
- 60
- Rep Power
- 0
- 05-20-2007, 09:00 PM #2levent Guest
You can use StringBuffer to do this:
Java Code:String st = new String("abcde"); st = StringBuffer(st).insert(2, "C").toString();
- 05-20-2007, 09:01 PM #3
Member
- Join Date
- May 2007
- Posts
- 60
- Rep Power
- 0
Thanks. It worked :)
- 06-11-2010, 02:11 AM #4
Looks like a missing new before the StringBuffer constructor call.
- 06-11-2010, 07:50 AM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
- 11-10-2010, 09:15 AM #6
Member
- Join Date
- Nov 2010
- Posts
- 1
- Rep Power
- 0
- 11-10-2010, 10:07 AM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
- 02-17-2011, 08:54 PM #8
Member
- Join Date
- Feb 2011
- Posts
- 7
- Rep Power
- 0
So... I was trying to use this as an example for what I'm trying to do. Basically I just want to add a 1 or a 0 to the end of a pre-existing String. <-binary conversion stuff.
Anyway, so when i try to do it, Eclipse keeps telling me a I need to create a method for StringBuffer(String)..
example..
output = StringBuffer(output).insert("0").toString();
But it should be noted that I've already included: import java.lang.*;
in my code... Help?
Sorry if this seems dumb. I'm extremely new to java and coding in general.
-
Please ask your new question in a new thread, rather than hijack and reanimate an old zombie thread.
Thanks.
Similar Threads
-
SQL Insert Help!!!!
By shaungoater in forum New To JavaReplies: 1Last Post: 06-14-2008, 03:14 AM -
Casting an int value into a char
By kurtulas in forum New To JavaReplies: 2Last Post: 02-16-2008, 08:03 PM -
Cannot convert from char to String error
By sondratheloser in forum New To JavaReplies: 1Last Post: 12-13-2007, 09:28 PM -
Char to String in java
By trill in forum New To JavaReplies: 1Last Post: 08-01-2007, 01:42 PM -
Help with, String, Char
By lenny in forum New To JavaReplies: 1Last Post: 07-25-2007, 02:58 PM


LinkBack URL
About LinkBacks


Bookmarks