Nov 18, 2005 #1 kylefield Technical User Joined Nov 10, 2005 Messages 7 Location US Is there a way (in a function) that I delete the first and last character of a string regardless of how long it is? Thanks.
Is there a way (in a function) that I delete the first and last character of a string regardless of how long it is? Thanks.
Nov 18, 2005 #2 alvechurchdata Programmer Joined Nov 8, 2003 Messages 1,737 Location GB There's not a single function that will do it but something like: [TT]Substr(lcText, 2, Len(lcText) - 2)[/TT] Be careful if you're getting the text from the field of a table. You will have to use TRIM() to take the trailing spaces off. Geoff Franklin http://www.alvechurchdata.co.uk Upvote 0 Downvote
There's not a single function that will do it but something like: [TT]Substr(lcText, 2, Len(lcText) - 2)[/TT] Be careful if you're getting the text from the field of a table. You will have to use TRIM() to take the trailing spaces off. Geoff Franklin http://www.alvechurchdata.co.uk
Nov 18, 2005 #3 cricket Technical User Joined Jul 5, 2000 Messages 361 Location IE The leading spaces problem needs also to be addresses SUBSTR(ALLTRIM(lcText),2,LEN(ALLTRIM(lcText))-2) Upvote 0 Downvote
The leading spaces problem needs also to be addresses SUBSTR(ALLTRIM(lcText),2,LEN(ALLTRIM(lcText))-2)