• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 62
  • Last Modified:

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.
0
sasllc
Asked:
sasllc
3 Solutions
 
slightwv (䄆 Netminder) 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
 
Fernando SotoCommented:
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
 
Ryan ChongCommented:
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now