Thread: chat.substring?
View Single Post
  #3  
Old 11-16-2007, 03:38 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
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";
__________________
Reply With Quote