translate function - InfoPath Dev
in

InfoPath Dev

translate function

Last post 01-28-2011 05:43 AM by Jimmy. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-26-2011 10:40 AM

    translate function

    field2=translate(field2, "';;", ";")

    I'm trying to replace double semi-colons with a single semi-colon 

    the result is both ;; are striped.

     

     

  • 01-28-2011 04:38 AM In reply to

    Interesting. translate() won't work for me either.

    I did manage to get something similar working:

    concat(substring-before(field1, ";;"), ";", substring-after(field1, ";;"))

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 01-28-2011 05:43 AM In reply to

    I'm afraid translate() doesn't work like that.  Translate replaces single characters with other single characters, or it can remove single characters:

    http://www.w3.org/TR/xpath/#function-translate

    You can probably rig up something with rules and tricky XPath functions, but you risk causing an infinite loop error if there are a lot of double semicolons.  The other alternative is to use code which, can remove them pretty easily.

     Can I ask why your values have these double semicolons in them to begin with?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.