ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Check if a string has certain characters

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Viking
    replied
    SCANRPL can be used to find certain characters in your string and replace them with something else, even '' (nothing), i.e. remove them.

    Leave a comment:


  • wegrace
    replied
    Use bif %check()

    Leave a comment:


  • RDKells
    started a topic Check if a string has certain characters

    Check if a string has certain characters

    Hello,

    I have a string that has text in it like 'Description' and I want to check it doesn't contain the following 3 characters; . ' "

    After googling and testing myself, as far I can see the only options I have are;

    1. Use xlate (which would involve putting every allowed value into a string to compare... not feasible)
    2. Use SCAN on each character

    Surely there's a way of doing this on 1 line?

    Cheers,
    Ryan
Working...
X