How to replace special character in string

 I have the string with multiple repeated special characters which needs to be replaced with another character.

 

Eg: s'd'g' has to be replaced with s@d@g@.

 

Please suggest.

  Discussion posts and replies are publicly visible

Parents
  • I agree with others using substitute as the right way of replacing special characters , There is another funny way to do the same functionality,

    with(
    local!a: "s'd'g'",
    local!b: a!forEach(
    items: reject(
    fn!isnull,
    split(
    local!a,
    "'"
    )
    ),
    expression: concat(
    fv!item,
    "@"
    )
    ),
    joinarray(
    local!b
    )
    )

    Output:

    "s@d@g@"
Reply
  • I agree with others using substitute as the right way of replacing special characters , There is another funny way to do the same functionality,

    with(
    local!a: "s'd'g'",
    local!b: a!forEach(
    items: reject(
    fn!isnull,
    split(
    local!a,
    "'"
    )
    ),
    expression: concat(
    fv!item,
    "@"
    )
    ),
    joinarray(
    local!b
    )
    )

    Output:

    "s@d@g@"
Children
No Data