View Single Post
  #2  
Old 12-06-2009, 02:54 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Switch View Post
Never knew the second param in substring() took off whatever the first param didn't include.
How substring works:

"testingfoobarbaz".substring(3, 5)

It starts at 3, so it excludes the red

tes
tingfoobarbaz


Then it will extract the text between starting index 3 and the length from this index.

tes
tingfoobarbaz


The text inbetween the colored text is what you end up with
__________________
Reply With Quote