Solved

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

Posted on 2016-09-28
3
23 Views
Last Modified: 2016-09-28
In my vb.net program, I just need to know if there is an "L" in the string--or not.
0
Comment
Question by:sasllc
3 Comments
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 50 total points
Comment Utility
Most languages have an INSTR function.

VB is one of them:
https://msdn.microsoft.com/en-us/library/8460tsh1(v=vs.90).aspx
0
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 300 total points
Comment Utility
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
 
LVL 49

Assisted Solution

by:Ryan Chong
Ryan Chong earned 150 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now