Home
About
Policies
FAQ
Forums
Registration
Password Recovery

Midstr (MPI)

From Tapestries MUCK

Revision as of 13:38, 30 March 2007 by Ash-Fox (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

midstr

{midstr:str,pos}
{midstr:str,pos1,pos2}

Returns the substring that starts at pos1 within str.

If no pos2 is given, then the returned string is only the character at the given pos1 position. if a pos2 position is given, then it returns the substring beginning at pos1 and ending at pos2, inclusive. If pos1 or pos2 are negative, then they represent the position that is that absolute number of characters from the end of the string. The first character in str is 1, and the last one can always be referenced by -1.

If a position would be before the beginning of the string, it is assumed to be at the beginning of the string. If it would be beyond the end of the string, it is assumed to be at the last character.

If the starting position is later in the string than the ending position, then the returned string has the characters in reverse order. If either pos1 or pos2 are 0, then this returns a null string. ("")

Personal tools
Namespaces
Variants
Actions
navagation
information
wiki
Toolbox