Forum Discussion

BradElmore's avatar
BradElmore
Qrew Assistant Captain
10 years ago

Removing character from Text field

I have a text field [Field A]. I would like to create a text formula field [Field B] that removes the character "-" from  [Field A] if [Field A] contains the character "-".

[Field A] = "abc-d"  [Field B] = "abcd"

Thanks

15 Replies

  • This solution is exactly what I need, but I need to run it multiple times, for different special characters. How could I do that?
  • Sorry about that, I responded to a similar post... which Alex linked already... It's regarding filtering out characters:

    Part([Project Name],1," !@#$%^&*';:?/><")

    My question is this... will this one line of code filter out all special characters listed, no matter how many times they are in the string? or do I need to add possible:

    Part([Project Name],2," !@#$%^&*';:?/><") etc?
  • No, the Part function will locate the nth part of a string as delimited by the delimiter characters.

    So you will need

    a formula like
    List "", 
    Part([Project Name],1," !@#$%^&*';:?/><"),
    Part([Project Name],2," !@#$%^&*';:?/><"),
    Part([Project Name],3," !@#$%^&*';:?/><"),

    etc

    Part([Project Name],10," !@#$%^&*';:?/><"))

    for as many "Parts" as your data might be expected to have.