How to validate alphabets in a string:

Hi,
Below code is useful to validate Only alphabets in a string.
static void TextBuffer_regularExpression(Args _args)
{
TextBuffer txt = new TextBuffer();
str msg = “ABCDEFGS”;
;

txt.setText(msg);
txt.regularExpressions(true); // activate regular expr in search

// Regular expression to validate only alphabets
if (txt.find(“^[A-Z]+$”))
{
info(“String contains only Alphabets”);
}
else
{
info(“String contains others characters”);
}

}

Advertisements

One thought on “How to validate alphabets in a string:

  1. Unquestionably imagine that which you stated. Your favorite reason appeared to
    be on the web the easiest factor to take into account of.
    I say to you, I definitely get irked at the same
    time as other folks consider worries that they just don’t recognise about.
    You managed to hit the nail upon the top and defined out the whole thing
    with no need side-effects , folks could take a signal.
    Will probably be again to get more. Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s