Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function PosEx(Str, Source : string, StartFrom : cardinal = 1): integer;
Returns an integer specifying the position of the first occurrence of one string within another, where the search starts at a specified position.
PosEx looks for the first complete occurence of Str in Source, beginning the search at StartFrom. If it finds one, it returns the character position in Source of the first character in Str as an integer value, otherwise it returns 0. PosEx also returns 0 if StartFrom is greater then Length(Source) or if StartPos is < 0
var s : string;
i : integer;
s:='DELPHI PROGRAMMING';
i:=PosEx('HI PR', s, 4);
//i=1;
|
String Types in Delphi
Understanding and managing string data types in Delphi's Object Pascal. Learn about differences between Short, Long, Wide and null-terminated strings.
Pos, Length,
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|