Excerpt | ||
---|---|---|
| ||
substring(string, startPosition, endPosition) Returns a portion of the supplied string between specified character positions. |
Function: substring()
Returns a portion of the supplied string between specified character positions.
...
substring(in.fileName, indexOf(in.fileName, "_")+1, indexOf(in.fileName, "_")+9)
Suppose in.fileName contained file names with the format "switchRC48_20060708.exp" and we wish to retrieve the date from the file name.
The first, string portion of the file name is variable so we search for the "_" character with the function indexOf, and use the returned value in substring to pull out the date from the file name.
...