LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Avoid Special Characters in string

Solved!
Go to solution

Hai.

I want only Alphabets & Digits to be entered in to my string.No any other special characters except spaces.How can I do this? 

0 Kudos
Message 1 of 7
(7,396 Views)

Hi kaustubh,

you can use an event structure to check which key is pressed. If you want to check the full string, then you can use a loop and check every single character if it is in a special range. You can use the corresponding byte value for it.

 

Hope it helps.

Mike

0 Kudos
Message 2 of 7
(7,389 Views)

Hai Mike

Thanks for ur reply.Actually I've used Match Regular With [^0-9][^a-z] as Regular Expression.But the results were not as I expected.I dont want user to enter any Special characters like !@#^>_:">? e.t.c

Hope so I've made it Clear. 

0 Kudos
Message 3 of 7
(7,387 Views)
Solution
Accepted by kaustubh

Hi kaustubh,

see the attached example.

 

Hope it helps.

Mike

Message 4 of 7
(7,380 Views)

MikeS81 wrote:

see the attached example.


I would allow a few more, e.g. 0 and 8 to allow editing of the entered string (backspace, cursor buttons, delete key, etc.).

Message Edited by altenbach on 11-21-2008 12:49 AM
Download All
Message 5 of 7
(7,367 Views)

HAI Mike.

Thanks for your reply

It really worked.Thanks alot. 

0 Kudos
Message 6 of 7
(7,364 Views)

kaustubh wrote:

Hai.

I want only Alphabets & Digits to be entered in to my string.No any other special characters except spaces.How can I do this? 


Sorry, I think you also want to allow the "space" character....

 

Simply add a 32 to my non-default case to do this. It should now read " 0, 8, 32, 48..122"

 

0 Kudos
Message 7 of 7
(7,329 Views)