Changeset fcf89c2 in tol


Ignore:
Timestamp:
Jun 24, 2010, 1:56:35 PM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
08771b9
Parents:
29f736f
Message:

New method RemoveLastSlash

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2326 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/stdlib/general/grammars/_text.tol

    r29f736f rfcf89c2  
    161161{
    162162  If(OSUnix, Replace(path,  "\\", "/"), Replace(path,  "/", "\\"))
     163};
     164
     165//////////////////////////////////////////////////////////////////////////////
     166  Text RemoveLastSlash(Text txt)
     167//////////////////////////////////////////////////////////////////////////////
     168{
     169  Real len = TextLength(txt);
     170  Text last = Sub(txt,len,len);
     171  If(Or(last=="/",last=="\\"), Sub(txt,1,len-1), txt)
    163172};
    164173
Note: See TracChangeset for help on using the changeset viewer.