JCL Help:StrMatch@AnsiString@AnsiString@SizeInt

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Returns the index of the first character in a specified sub-string that occurs in a given string.


Pascal

 function StrMatch(const Substr: string; const S: string; Index: SizeInt = 1): SizeInt;
function StrMatch(const Substr: AnsiString; const S: AnsiString; Index: SizeInt = 1): SizeInt;


Parameters

Parameters Description
const Substr: string The sub-string to search for. May contain wildcards.
Index: SizeInt = 1 The index in Str at which to start the search.
Str The string in which to search.


Return Value

One-based index of the first character of SubStr in Str or 0 if SubStr does not occur in the supplied string.


Description

StrMatch returns the index of the first character in a specified sub-string that occurs in a given string. The search starts at the supplied index and is case-insensitive. The specified sub-string may contain wildcards. The '?' wildcard matches 1 character while the '*' wildcard matches 0 or more occurrences of a character. For example, 'J?DI' will find 'JEDI', 'JZDI' and 'JODI' (and more) while 'J*I' will find 'JEDI' and 'JI'.


See Also

StrSearch


About

Unit

JclAnsiStrings


Donator

Azret Botash


Notes

The '*' wildcard currently doesn't work correctly, it produces the same result as '?'.


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page