Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Left String Function

Status
Not open for further replies.

Bluejay07

Programmer
Mar 9, 2007
780
0
0
CA
Hello,

I am trying to use the left string function, however, Visual Studio thinks I am trying to access the left integer function.

Code:
If Left(Trim(txtURL.Text), 7) = "[URL unfurl="true"]http://"[/URL] Then

Any suggestions on how I can use the string function for 'left'.

Thanks.
 
Try Microsoft.VisualBasic.Left(). Many of the old-style VB functions used in VB6 and earlier live in the Microsoft.VisualBasic namespace. If you want a pure .Net way to accomplish this, try
Code:
If txtURL.Text.Trim.StartsWith("[URL unfurl="true"]http://")[/URL] Then
 
Thank RiverGuy,

You are correct. I was trying to make use of the VB6 methods.

I will try your .net suggestion.

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top