There are a lot of questions to your question?
What characters are we talking about?
Do you want to limit the number of characters during typing or do you want to use a piece of the text after entering the text?
What type of textbox are you using?
There is an extension made by @Ken with which you can limit the length of a textbox.