Ignore case indexof

Hi,

I have a text and search indexof a word. But text include this word twice and one is big lettes. But I want to go the second. For example word is Total:

Date : 30.04.2024
TOTAL : 66.530,00
April Pax Contribution 3187adl+279chd 125.784,56
Total: 192.314,56
We hereby Credit your current acount in our statements.

I want to get 192.314,56 for this I use lastIndexof “Total” but sometimes letter size changes.

Date : 30.04.2024
Total: 66.530,00
April Pax Contribution 3187adl+279chd 125.784,56
Total: 192.314,56
We hereby Credit your current acount in our statements.

And I get 66.530,00 value which wrong

The image is a screenshot of a code debugging window displaying a variable  with its value being a financial report, along with results of  and  operations searching for the substring "total". (Captioned by AI)
we can set the StringComparison Type

maybe better to use Regex for this

System.Text.RegularExpressions.Regex.Matches(strText,"(?i)(?<=total.*)[\d,.]+").Select(Function (x) x.Value).LastOrDefault()

Hie @Murat
here’s your Input


Now here’s the regex pattern

System.Text.RegularExpressions.Regex.Match(strName,“Total:\s(\d*)(?:.)+(\d*)(?:,)+(\d*)”).Value

and finally your output

cheers Happy Automation

Hello @Murat
Try by ToUpper / ToLower the whole string and use Regex

System.Text.RegularExpressions.Regex.Match(YourStr.ToLower,"(?<=total: )[\d,.\n]+(?=we)").tostring.trim