Link to home
Start Free TrialLog in
Avatar of MJ
MJFlag for United States of America

asked on

How to standardize Token in a string by making upper case and removing all spaces?

If I have a token in a string but I want to ensure it is only upper case and contains no spaces, how would I do this? Only the token will have the square brackets in the string.

Input Examples:

1) ?n1=v1&n2= [new vs returning]&n3=v3
2) [New vs Returning]&n3=v3
3 [  NEW     VS retur  nin g      ]&n3=v3
4) ?n1=v1&n2= [current url]&n3=v3
5) ?n1=v1&n2= [    CurRent   uR  l  ]&n3=v3

Output Examples:

1) ?n1=v1&n2=[NEWVSRETURNING]&n3=v3
2) ?n1=v1&n2=[NEWVSRETURNING]&n3=v3
3) ?n1=v1&n2=[NEWVSRETURNING]&n3=v3
4) ?n1=v1&n2=[CURRENTURL]&n3=v3
5) ?n1=v1&n2=[CURRENTURL]&n3=v3

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MJ

ASKER

Hi Leakim,
This doesn't seem to be working for me?
Avatar of MJ

ASKER

Sorry my mistake! Thanks!
Avatar of MJ

ASKER

Thanks again!