Thursday, February 26, 2015

Switch with Regex

Hi,


I'm having some trouble replicating this powershell code in C# could anyone give me a hand or point me in the right direction?


Powershell:



$FirstLetter = $Promoter.Substring(0,1)
Switch -Regex ($FirstLetter)
{
"[A-G]" {"A - J"}
"[K-Z]" {"K - Z"}
}





If this is helpful please mark it so. Also if this solved your problem mark as answer.


No comments:

Post a Comment