Click here to Skip to main content
15,037,662 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have restricted the special characters in text input but it is accepted the square brackets, how can i restrict the square brackets in text input..Thanks in Advance.

1 solution

You mean "[" and "]" ??

Sort them out.

the class Java.lang.String[^] contains methods for

- String.indexOf(String)[^] which returns a positive natural number if it found some or -1 when not.

- String.replaceAll(String, String)[^] to replace a certain expression in a String.

Be aware that those functions return the new formatted String.
Flex_Query 21-Dec-11 23:56pm
Thank you for your reply,but i asked how to restrict the "[" "]" (square brackets).i did not get your reply message.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900