Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PString PString::Right ( PINDEX  len  )  const [inherited]

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.

Returns:
substring of the source string.
Parameters:
len  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)
    return Empty();

  PINDEX srclen = GetLength();
  if (len >= srclen)
    return *this;

  return PString(theArray+srclen-len, len);
}


Generated by  Doxygen 1.6.0   Back to index