hi , iam using asp.net with c#.
in my login the user names are 0198, 0276,03....05
when the user logins then based on the first two letters digits 01,02,03
i have to display all departments in a dropdownlist
how to seprate this starting two letters when user login
can you give example which helps me
How to read first two letters from the string
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VikramRank #9,295 · 208 reputationPosted May 26, 2010, 5:53 AM EDT
user following,
username.Substring(0, 2)
CrishRank #1,487 · 1.1K reputationPosted May 26, 2010, 6:27 AM EDT
use below code for your solution
username.Substring(0,2).
Also check length of the string else you will get error when you don't have user name's string character more than 1.
Thanks