mauede
Well-known member
This is a trivial problem but I cannot get a solution.
I am trying to make my code recognize strings like the following:
"PTV1_3000", "ITV3_4000"
The sub-string should contain a root-like "PTV", "ITV", "CTV" followed by one or more integer numbers followed by "_".
I tried different flavors of the following expression:
Is it possible to find alphanumeric sub-strings in a string?
Thank you so much
I am trying to make my code recognize strings like the following:
"PTV1_3000", "ITV3_4000"
The sub-string should contain a root-like "PTV", "ITV", "CTV" followed by one or more integer numbers followed by "_".
I tried different flavors of the following expression:
C#:
string str = "ITV2_123";
if(str.Contains("ITV[0-9]*$_"))
{
Console.WriteLine("String OK)");
}
else
{
Console.WriteLine("string KO");
}
Console.ReadKey();
Is it possible to find alphanumeric sub-strings in a string?
Thank you so much