is there a trim function where you can specify what character to trim?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kayakbabe
    Mega Mivite




    • Jun 2008
    • 1520

    #1

    is there a trim function where you can specify what character to trim?

    I know
    <mvt:assign name="g.return_value" value="rtrim( string )" />
    strips off spaces if they exist at the right end of the string. what I"m looking for is something like
    <mvt:assign name="g.return_value" value="rtrim( string , char )" />
    which would strip off the right most character if it matches what I specify.

    is there such a thing?
  • Brennan
    Super Moderator









    • Jun 2009
    • 3481

    #2
    No, but you could build it yourself. You could use substring to grab the last characters you need, then compare them to your character you want to remove and if it matches then do the trim (if not, don't trim)
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment

    • kayakbabe
      Mega Mivite




      • Jun 2008
      • 1520

      #3
      that's what I did.. thanks brennan

      Comment

      Working...
      X