Nov 18, 2005 #1 kylefield Technical User Nov 10, 2005 7 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 Nov 8, 2003 1,737 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 Jul 5, 2000 361 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)