UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Extracting Text From A Text String Using Left Function?, Any Version    
 
   
likajoho
post Apr 15 2017, 09:15 AM
Post#1



Posts: 1,065
Joined: 18-February 04
From: Oklahoma


I want to extract text from a string deleting the first 3 characters. I think I can use the Left function in combination with some other function to remove those left 3 characters. So far the how has eluded me. I tried a simple -, but that didn't work.

Thank you for reading my post and for any suggestions.
Go to the top of the page
 
Doug Steele
post Apr 15 2017, 09:20 AM
Post#2


UtterAccess VIP
Posts: 21,200
Joined: 8-January 07
From: St. Catharines, ON (Canada)


From your description, it sounds as though you want to return all but the first three characters. In other words, if the string is UtterAccess, you want to return erAccess.

If that's the case, you want to use the Mid function, not the Left function:
CODE
  strNewString = Mid(strOldString, 4)

(the third parameter for the Mid function, length of string, is optional if you want everything after the start position you've given)

--------------------
Go to the top of the page
 
likajoho
post Apr 15 2017, 10:19 AM
Post#3



Posts: 1,065
Joined: 18-February 04
From: Oklahoma


Great! I didn't realize the length was optional and that was where my difficulties were.

Thanks!

Go to the top of the page
 
Doug Steele
post Apr 15 2017, 11:49 AM
Post#4


UtterAccess VIP
Posts: 21,200
Joined: 8-January 07
From: St. Catharines, ON (Canada)


If the length was mandatory, you could use

CODE
    strNewString = Mid(strOldString, 4, Len(strOldString) - 3)


--------------------
Go to the top of the page
 
likajoho
post Apr 15 2017, 04:57 PM
Post#5



Posts: 1,065
Joined: 18-February 04
From: Oklahoma


Thanks Doug
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    23rd July 2017 - 05:41 PM