I want to retrieve the linenumber in a stringlist (loaded from a file).
Indexof seems to match exactly. Is there a way to retrieve the line with a wildcard-version of Indexof? something like SL.Indexof(‘?sometext’)?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to match some part of the string, without any fancy wildcards, as you indicate in a comment to another answer, then you can use a simple function like this:
If you want a case-insensitive match then you can use this:
ContainsStrandContainsTextare defined in theStrUtilsRTL unit and follow the standard convention ofStrto indicate case sensitive comparison, andTextto indicate case insensitive.