c# indentiying the first two characters of a string

vcurtis
vcurtis used Ask the Experts™
on
Need Help
  I have a string and I want to find out if the first two characters are equal to a certain value when passed in. for example

"Employee".......are the first two letters of this string "EM"
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Freelance programmer / Consultant
Commented:
String s = "Employee";
            bool b = s.ToUpper().StartsWith("EM");
b is true in this case

Author

Commented:
Thanks Andy
  That is exactly what I needed

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial