Split my complex string

Hello all. I have a problem
I need to Splti this string: “№ 11_12_1314 by 17.06.2020” and eventually get only “11_12_1314”.
But the problem is that the string may look like “by 17.06.2020 № 11_12_1314”

If the part you need always have this format: 11_11_1111 you can use regex like this:
System.Text.RegularExpressions.Regex.Match("№ 11_12_1314 by 17.06.2020", "\d{2}_\d{2}_\d{4}").Value

wow, thanks a lot

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.