Solved

c# indentiying the first two characters of a string

Posted on 2014-02-25
2
303 Views
Last Modified: 2014-02-25
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"
0
Comment
Question by:vcurtis
2 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 39886644
String s = "Employee";
            bool b = s.ToUpper().StartsWith("EM");
b is true in this case
0
 

Author Closing Comment

by:vcurtis
ID: 39886714
Thanks Andy
  That is exactly what I needed
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question