This pattern means that it will reverse any string which contains range of letters from a to z and A to Z and also range of numericals from 0 to 9. So, if you keep your pattern like "[a-z A-Z]" and suppose you give your string as "QUeR123y"; so your answer will be "yReUQ". It will not consider the numbers since you skipped them when you defined your pattern. I hopr you got it.
2 comments:
Thanks for your post J B C.
But i wanted to know what that pattern means?
r.pattern="[a-z A-Z]"
This pattern means that it will reverse any string which contains range of letters from a to z and A to Z and also range of numericals from 0 to 9.
So, if you keep your pattern like "[a-z A-Z]" and suppose you give your string as "QUeR123y"; so your answer will be "yReUQ". It will not consider the numbers since you skipped them when you defined your pattern.
I hopr you got it.
Post a Comment