Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private string substitution(string inString)
- {
- string normalAlphabet = "abcdefghijklmnopqrstuvwxyz .!?,";
- string cipherAlphabet = "efg.hijk!lmn opqr?stuv,wxyzabcd";
- string cipheredText = "";
- inString = inString.ToLower();
- for (int index1 = 0; index1 < inString.Length; index1++)
- {
- for (int index2 = 0; index2 <= 30; index2++)
- {
- if (inString[index1] == normalAlphabet[index2])
- {
- cipheredText = cipheredText + cipherAlphabet[index2];
- }
- }
- }
- return cipheredText;
- }
- private string transposition(string inString)
- {
- int myCounter = 0;
- string theFirstWord = "";
- string theLastWord = "";
- while (myCounter < inString.Length)
- {
- theFirstWord = theFirstWord + inString[myCounter];
- myCounter += 2;
- }
- for (myCounter = 1; myCounter < inString.Length; myCounter += 2)
- {
- theLastWord = theLastWord + inString[myCounter];
- }
- return (theFirstWord + " " + theLastWord);
- }
Add Comment
Please, Sign In to add comment