Remove Char from Concat string - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Remove Char from Concat string

Last post 07-08-2011 08:37 PM by Jimmy. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-05-2011 10:15 AM

    Remove Char from Concat string

     Hello all.

    I have concat a string from repeating table textbox  separated by a Semicolon ";" .ie Sam;Stela;Jon;Methues

    Now my requirement is to remove a  string as Jon.Then i remove Jon with the help of translate function as  translate(., Jon, "").

    But Semicolon is remaining. I am also tried  translate(., concat("Jon",";"), "") but didn't get any success.

    Or how i concat a string without this string(Jon), I am using that formula

    substring(eval(eval(EmployeeDetail, 'concat(my:Employee, "; ")'), ".."), 0, string-length(eval(eval(EmployeeDetail, 'concat(my:Employee, "; ")'), "..")) - 1)

    Any one tell me how this problem will solved.

    Any help will greatly appreciated. Thanks in advance.

     

    Filed under: ,
  • 07-08-2011 12:53 PM In reply to

    Re: Remove Char from Concat string

    Hi RickyPonting,

    Fancy evals you are using fine sir! :)  I'm wondering why you need the eval(eval(...)) for the string-length. Seems a bit weird.

    How does translate(., Jon, "") work at all. I'd think you would need to have Jon in double quotes - translate(.,"Jon","")

    If that works, then the concat with semicolon should work too.

    More later,

    Patrick Halstead
    Project Manager at Qdabra
  • 07-08-2011 08:37 PM In reply to

    Re: Remove Char from Concat string

    The answer to your second question is easier.  You can use:

    eval(eval(EmployeeDetail[my:Employee != 'Jon'], 'concat(my:Employee, "; ")'), '..')

    If you don't want a last semicolon at the end, you can do this:

    substring(eval(eval(EmployeeDetail[my:Employee != 'Jon'], 'concat("; ", my:Employee)'), '..'), 3)

    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.