Click here to Skip to main content
15,883,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to read or find character from word in c# web application
Posted

try this

C#
string Result = string.Empty;
            string example = "1234#56890";
            for (int k = 0; k < example.Length; k++)
            {
                if (example[k] == '#')
                {
                    Result = "Matches";
                }
            }
 
Share this answer
 
Comments
RaviRanjanKr 17-May-11 6:27am    
Nice Answer, My 5 :)
RaviRanjanKr 17-May-11 6:29am    
You can also use "Contains" properties of String to find whether it is exist or not.
string str = "Words";
bool res = str.Contains("Search Value");
if(res== true)
{
// Yes Contain.
}
Prasanta_Prince 17-May-11 6:36am    
Good one.
Mahendra.p25 17-May-11 6:51am    
Thanks
Try
MIDL
string MainString = "String Manipulation";
           string SearchString = "pul";
           int FirstChr = MainString.IndexOf(SearchString);
           //SHOWS START POSITION OF STRING

           MessageBox.Show("Found at : " + FirstChr);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900