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

PString PString::Left ( 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 beginning 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 end of the string are returned.

If len# is zero then an empty string is returned.

substring of the source string.
len  Number of characters to extract.

Definition at line 1811 of file contain.cxx.

References PString::Empty(), PString::GetLength(), and PString::PString().

Referenced by PTrace::Begin(), PFilePath::GetDirectory(), PFTPClient::GetSystemType(), PDirectory::GetVolume(), PDirectory::GetVolumeSpace(), PURL::InternalParse(), PSerialChannel::Open(), PSystemLog::Output(), PInternetProtocol::ParseResponse(), PHTTP::ParseResponse(), PInternetProtocol::ReadCommand(), PInternetProtocol::ReadResponse(), PRemoteConnection::SetConfiguration(), and PSTUNClient::SetServer().

  if (len <= 0)
    return Empty();

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

  return PString(theArray, len);

Generated by  Doxygen 1.6.0   Back to index