1. Technology
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

PosEx

unit
StrUtils
category
string handling routines

declaration
function PosEx(Str, Source : string, StartFrom : cardinal = 1): integer;

description
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

example
var s : string;
    i : integer;
	
s:='DELPHI PROGRAMMING';
i:=PosEx('HI PR', s, 4);
//i=1;

in real code
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.

see also
Pos, Length,


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?

©2014 About.com. All rights reserved.