Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

c# indentiying the first two characters of a string

Posted on 2014-02-25
2
Medium Priority
?
329 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 45

Accepted Solution

by:
AndyAinscow earned 2000 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
Screencast - Getting to Know the Pipeline

810 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