Interview Questions

Wednesday, May 14, 2014

Alphabets In String Ax

static void AlphabetsInString(Args _args)

{
TextBuffer txt = new TextBuffer();
str msg = "AbcdAzjjtref59995";
;

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");
}

}

No comments:

Post a Comment