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
String Types in Delphi
var s : string;
i : integer;
i:=PosEx('HI PR', s, 4);
Understanding and managing string data types in Delphi's Object Pascal. Learn about differences between Short, Long, Wide and null-terminated strings.
Free Delphi code snippet inside every Delphi Newsletter!|
Got some code to share? Got a question? Need some help?|