help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Procedures and functions] Reference for unit 'strutils' (#rtl)

NPos

Returns the position of the N-th occurence of a substring in a string.

Declaration

Source position: strutils.pp line 135

function NPos(

  const C: String;

  S: String;

  N: Integer

):Integer;

Arguments

C

  

Substring to search for

S

  

String to search.

N

  

Which position to return

Function result

Position of N-th occurrence of the substring, -1 if there is none.

Description

NPos checks S for the position of the N-th occurrence of C. If C occurs less than N times in S, or does not occur in S at all, 0 is returned. If N is less than 1, zero is returned.

Errors

None.

See also

WordPosition

  

Search position of Nth word in a string.

FindPart

  

Search for a substring in a string, using wildcards.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505