Solved

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

Posted on 2016-09-28
3
37 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
ID: 41820959
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 63

Accepted Solution

by:
Fernando Soto earned 300 total points
ID: 41820964
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 50

Assisted Solution

by:Ryan Chong
Ryan Chong earned 150 total points
ID: 41820965
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

839 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