The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



ExtractWordFromString


Unit:SDL_stringl
Class: none
Declaration: [1] function ExtractWordFromString (const InString: string; const Pos: integer): string;
[2] function ExtractWordFromString (const InString: string; const Pos: integer; var FirstIdx, LastIdx: integer): string;

The function ExtractWordFromString extracts the word at the character position Pos from the string InString. The word boundaries are defined by the constant WordSeps; all characters which are not part of WordSeps are considered to belong to the extracted word.

Version [1] simply returns the extracted string, while version [2] additionally returns the string indices of the extracted word in the variable parameters FirstIdx and LastIdx.


Last Update: 2012-Oct-20