Friday, February 17, 2012

String Swapper App for my personal coding use


I made this app because I was sick of redundantly swapping out X an Y's in code.

A text-editor takes 3 steps and requires a proxy variable.
Example:
Step1: X replaced to K.
Step2: Y replaced to X.
Step3: K replaced to Y.

My App Requires ONE(1) step:
Step1: X swapped with Y.

Done!

Unfortunately, I thought this code was going to be simple...
And as a result of my hubris, this function is NOT token based.
Which means that if you tried to swap "A" with "APPLE" you might
have a problem since "A" is contained within "APPLE".

Good news though, for complex variable names, you can put in a list of
things you want swapped and do it in one operation!

No comments:

Post a Comment