Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i need to write a function to find the letter is found in the give text for example

public boolen value(string text,string valuetosreach)
{
}



value(rajesh,je);


pls give me sample
Posted

1 solution

C#
public static bool FindLetter (string text, char letter)        
{
    foreach (var c in text)
    {
        if (letter == c)
        {
            return true;
        }
    }
    return false;
}
 
Share this answer
 
v2

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