Check if a character is in the English alphabet or a number 0 to 9

Hi, I am using a 16x2 display with arduino and foreign characters don't display correctly I don't want to try to display the characters as I would not gain much except bulk out my code on arduino so I want to stop the characters being sent in my app. So my question is this:
in Delphi we can check to see if a character is in a list using in ['a'..'z'] or in ['A'..'Z'] or in ['0'..'9'] is there another way to do this in ai without making list with a-z plus A-Z plus 0-9 and then checking each item?

There is no built in function to do this, you will need to build the lists and iterate over them.

ok thanks again

Three ways

  1. Substitute characters using a Dictionary How can i change format EN numbers to Arabic numbers

2.)

, which is one way to use a List to capture characters with unlauts ä/ö/ü* or an esset ß

3.) Using Lists by comparing. One example: Replace item character in listview

  1. probably other ways but as Tim indicated, there is no built in function.

now that's a good idea I like this thank you

1 Like

This will filter all non English language characters and numerals simply

thanks again I was just working on this

just one more thing how to add a space to the list? I have tried the obvious is there an escape character like \n etc?

Try

probably require characterFilteringWithSpace2 reads true but then esset also reads true.

experiment and you might find a useful combination. :cry: The contains any might not be able to differentiate a space.

again thank you I'll try

There are also extensions on Regular Expression:

Or JavaScript
w3schools.com/js/js_regexp.asp

1 Like

thank you it looks very good I will have a look

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.