
11-16-2007, 03:38 AM
|
|
Incubator
|
 |
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
|
|
|
Uh, trim() is a function not a variable. Also substring() can be used two ways, the first being like you said.
variable.substring(index);
The index being the index of the character you want to start the substring at. The second way being:
variable.substring(index, length);
Length is the amount of characters after the index that you want included in the substring, you can use a length of -1 for all characters.
"abcdefghi".substring(4) == "efghi";
"abcdefghi".substring(4, -1) == "efghi";
"abcdefghi".substring(3, 3) = "def"; |
|
|
|