How to determine if the "L" character is the string?

In my vb.net program, I just need to know if there is an "L" in the string--or not.
LVL 3
sasllcAsked:
Who is Participating?
 
Fernando SotoConnect With a Mentor RetiredCommented:
Try the Contains method something like this.

Dim s = "the string has a L in it"
If s.Contains("L") Then
    '' it has an L
End If
0
 
slightwv (䄆 Netminder)Connect With a Mentor Commented:
Most languages have an INSTR function.

VB is one of them:
https://msdn.microsoft.com/en-us/library/8460tsh1(v=vs.90).aspx
0
 
Ryan ChongConnect With a Mentor Commented:
or try use IndexOf function:
Dim Str As String = "Hello World"
        Dim isFound As Boolean = (Str.IndexOf("L") > 0)
        MessageBox.Show("isFound = " + isFound.ToString())

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.