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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strings

Status
Not open for further replies.

Geo45

Technical User
Jul 17, 2002
19
GB
OK I have a string varible called textstr, it stores a string that i only want part of

Ie

textstr = "hello"
now I want to only shore the last 3 letters in the string so..
textstr = "llo"

Please help

Geo45
 
see the right function in access help

right(string,length)

right("hello", 3)

 
hi,

Here is some functions for string manipulation:

LEFT(<string>, <nb char>) : Return the first <nb char> of <string> from the left

Ex:
left(&quot;Hello&quot;,2) Will give He

RIGHT(<string>, <nb char>) : Return the first <nb char> of <string> from the right

Ex:
left(&quot;Hello&quot;,3) Will give llo

MID(<string>, <start>, <end>): Return part of <string>

Ex:
Mid(&quot;Hello&quot;, 2, 3) will give ell
Mid(&quot;Hello&quot;, 3, 1) will give l
Mid(&quot;Hello&quot;, 2) will give ello

INSRT (<start>, <string1>, <string2>) : Retrun the starting position of <string2> if its found in <string1>

Ex:
Instr(1, &quot;Hello&quot;, &quot;e&quot;) will give 2
Instr(1, &quot;Hello&quot;, &quot;l&quot;) will give 3
Instr(4, &quot;Hello&quot;, &quot;l&quot;) will give 4


Hope it can help!
Mal'chik [bigglasses]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top