Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: dstaceyHi,
Is there a simple way of capitalizing certain letters using regexSubsitute?
As an example if I create a string how can I capitilize the first letter and swap its position with the second character?
e.g.
x = "abcdef"
y = regexSubstitute(x,"(.)(.)","$2$1",1) #swaps the letters over
z = regexSubstitute(x,"(.)(.)","$2\u$1",1) #I thought using \u would work but it throws an invalid escape sequence error
Any help anyone can give me on this is much appreciated - in general is there a document or graph that lists all the special character support and/or some more examples?
Thanks
Dave