[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Cycling character strings
- From: meino.cramer@...
- Date: Sat, 18 May 2013 12:33:22 +0200
Hi,
suppose one have this string of letters:
abcdefghijklmnopqstuvxyz
in an array (table) and want to perform these steps:
1. shift the string by a certain amount of characters cyclic
abcderfghijklmnopqstuvxyz => ghijklmnopqstuvxyzabcderf
2. take off a character at a certain position
ghijklmnopqstuvxyzabcderf +> g ijklmnopqstuvxyzabcderf
h
3. shift again
ghijklmnop qstuvxyzabcderf
4. insert letter at free position
ghijklmnophqstuvxyzabcderf
How can I do these steps in lua most efficiently?
Thank you very much in advance for any help!
Best reagards,
mcc