Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change to opposite case of all letters in string
#1
Hi,

My little laptop keyboard has Capslock right next to the letter A, and I get strings of tHE wRONG cASE sometimes. (My left pinky is a little bent from surgery after a roller blading accident, and that doesn't help much! :>)

I saw your post on how to change case to upper or lower case, but is there a way to **select text and make it into the opposite, even it includes upper and lower case letters?**

Thanks! I've had this program for years but have never gotten past the easy stuff! I still love it, and the addition of expanding pop up menus has been a real treat!
- Bob
#2
This may help: (quite cool actually) http://www.quickmacros.com/forum/showthread.php?tid=27
If not, let me know.
#3
Code:
Copy      Help
str s.getsel
if(!s.len) ret
int i is
for i 0 s.len
,if(isalpha(s[i]))
,,is=1
,,if(isupper(s[i])) s[i]=tolower(s[i])
,,else s[i]=toupper(s[i])
if(is) s.setsel

;testTEST 555


Attached Files
.qml   str.InvertCase.qml (Size: 440 bytes / Downloads: 468)
#4
Wow, that is beautiful! Thanks, Gintaris!

Hey, It'sJustMatt: thanks for that macro link! It works like a charm. I can hit Capslock all I want and the ghost in the machine turns it off immediately. It will only stay on with Ctl-Capslock, as advertized!

- Bob
- Bob


Forum Jump:


Users browsing this thread: 1 Guest(s)