Friday, January 3, 2020
What is Delphis Pos function
The Pos function in Delphi returns an integer specifying the position of the first occurrence of one string within another. Its instantiated like this: Pos(String,Source); What It Does Pos looks for the first complete occurrence of the specified String ââ¬â generally offered literally, in single quotes ââ¬â in Source. The Source is usually some variable. If Pos finds the string, it returns the character position in Source of the first character in Str as an integer value, otherwise it returns 0. The String and the Source must both be strings. Example var s : string; i : integer; s:DELPHI PROGRAMMING;i:Pos(HI PR,s); In this example, the variable i will return the integer 5, because the specified string begins with the letter H, which is in the fifth position in Source.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.