[FREE] CharsValidator Extension V-1 Harsh Vardhan Solanki

Hello Everyone,
I created an amazing validating extension to make Sign Ups more easier and can easy to identify the Name is correct or not?

And Able to help you with the Mobile Number checking also with a set of list texts.

It only have one block :

text: Any text you want to enter,
invalidChars: It is a set of characters like this !@#$%^&*()_+=[]{}|\\:;\"'<>,.?/~ 1234567890₹
if set to default it will give validation from above list.

But if invalidChars like this below entered :

It will check is any character is in the text entered or not.

Now you are thinking why we cannot use isContains block from the builder, that component will need too much time to and give bulk to the app for one by one validation,

But in this extension we can do enter list like above and check is there are any invalidChars contains in the text in the sign up form or any.

If the invalid character contains in the text it will returns true if not contains it will return false

If the invalidChars set to "default" then it will contains validate from the default list mentioned above.

Big thanks to @TIMAI2 for giving me idea of this code. :v:

Aix File : CharsValidator.aix (5.7 KB)

Test Aia : CharsValidator.aia (11.2 KB)

Some Test Screenshot :






Disclaimer: I do not add spaces in the characters list, it cannot validate the spaces as these are necessary in full names.

2 Likes

For example:

image

image

 @SimpleFunction(
          description = "Check if the text contains valid characters, enter invalidChars = 'default' to set to the default list"
  )
  public boolean IsValid(String text, String invalidCharacters) {
    String def = "default";
    if (invalidCharacters.equals(def)) {
      invalidCharacters = "!@#$%^&*()_+=[]{}|\\:;\"'<>,.?/~`1234567890₹";
    }

    List var4 = Arrays.asList(text.split(""));
    List var5 = Arrays.asList(invalidCharacters.split(""));
    Iterator var6 = var4.iterator();
    String var7;
      do {
        if (!var6.hasNext()) {
          return true;
        }
        var7 = (String)var6.next();
      } while(!var5.contains(var7));
      return false;
  }

It is returning the true and false values. But okay i got your point

Yes, that's correct:

1 Like

Updated :

2 Likes