LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Replace list

    Employee
    Posted 12-06-2016 03:45

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Staven

    Hi there,

    For the following I wasn't able to find an existing answer on the forum.

    I'm wondering if the following is possible using a correct syntax:

    replace(Stringfieldwithnumbers, list(".", ","), "")

    I have a string field containing a combination of numbers, points and decimals. Instead of having to use the replace function over and over, is there a way to hold a list of characters against a field and replace those characters with the specified replacement with a simple function (combination)?

    Thank you


  • 2.  RE: Replace list

    Employee
    Posted 12-06-2016 06:30

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: awilliams1024

    Hi,

    a simple combination of replacements can be performed using:

    result = Stringfieldwithnumbers.replace(".","").replace("," ,"")

    If you want to be able to use a list object then you will need to use something like the following:

    Replace_Using_List.brg

    If you need to replace double quote characters you will need to escape the double quote character in the replace() or list() e.g. using "\""

    Regards,
    Adrian