Results 1 to 4 of 4
- 06-15-2008, 05:38 PM #1
Member
- Join Date
- Jun 2008
- Posts
- 2
- Rep Power
- 0
- 06-15-2008, 06:53 PM #2
Member
- Join Date
- Jun 2008
- Posts
- 2
- Rep Power
- 0
I'm that far:
public String removeCharAt(String s, int pos) {
return s.substring(0,pos)+s.substring(pos+1);
}
How do I make it to cut off the first 11 characters of the string?
- 06-16-2008, 03:45 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
It's much easy to get a subString fro the original string. But in that case, the length of the cutting parts should be fix, at the time.
Java Code:String str = "CatIsEatingDinner"; int length = str.length(); String temp = str.substring(3, (length - 6)); System.out.println(temp);
- 06-16-2008, 03:47 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Similar Threads
-
Error: cannot resolve symbol' on Person (java.lang.String, java.lang.String)
By baltimore in forum New To JavaReplies: 2Last Post: 09-18-2008, 07:30 AM -
Using java.util.Scanner to search for a String in a String
By Java Tip in forum Java TipReplies: 0Last Post: 11-20-2007, 04:59 PM -
Help with insertName(String name) and deleteName(String name)
By trill in forum New To JavaReplies: 1Last Post: 08-07-2007, 07:29 AM -
I can't seem to pass the value of a string variable into a string array
By mathias in forum Java AppletsReplies: 1Last Post: 08-03-2007, 10:52 AM -
int and String, help me
By lenny in forum New To JavaReplies: 1Last Post: 07-24-2007, 12:14 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks