Extract a portion of the string into a new string. The original string is not changed and a new unique reference to a string is returned.
A substring from the end of the string for the number of characters specified is extracted.
If len# is greater than the length of the string then all characters to the beginning of the string are returned.
If len# is zero then an empty string is returned.
- substring of the source string.
Number of characters to extract. |
Definition at line 1823 of file contain.cxx.
References PString::Empty(), PString::GetLength(), and PString::PString().
Referenced by PTrace::Begin(), PIpAccessControlEntry::Match(), and PSystemLog::Output().
if (len <= 0)
PINDEX srclen = GetLength();
if (len >= srclen)
return PString(theArray+srclen-len, len);