We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,085 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Functions

I am trying to populate a text box by taking the first 8 characters of a string in a list box. I have heard of a left mid and right function. Does anybody know how to use these functions?

Thanks in advance :)

4
Contributors
3
Replies
1 Day
Discussion Span
1 Year Ago
Last Updated
4
Views
ng5
Light Poster
42 posts since Dec 2011
Reputation Points: 19
Solved Threads: 0
Skill Endorsements: 0

The substring function lets you specify a start point in the string and how many characters to take from that point. So to take the first 8 characters of a string would be:

string smallString = longString.subString(0,8)

Left and right accept the string and the number of characters to take as parameters. Mid takes the string, the start position and the number of characters to take. E.g.
Dim s As String
s = Left(s, length)
s = Mid(s, start, length)
s = Right(s, length)

hericles
Veteran Poster
1,065 posts since Nov 2007
Reputation Points: 156
Solved Threads: 228
Skill Endorsements: 9

surely you could have looked this up in microsofts reference material

http://msdn.microsoft.com

ChrisPadgham
Posting Pro in Training
451 posts since Sep 2009
Reputation Points: 127
Solved Threads: 88
Skill Endorsements: 5

>>...I have heard of a left mid and right function. Does anybody know how to use these functions?
I have heard that those are vb6- Functions and you should try to move on from those; even though they are still available for the migrating.programmers from "basic?" to use .net, .net.Functions as .Substring and/or your own Functions, can do most of the content.extract stuff, If Not more.

codeorder
Postaholic
2,124 posts since Aug 2010
Reputation Points: 256
Solved Threads: 387
Skill Endorsements: 8

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0640 seconds using 2.7MB