All pastes #271844 Raw Edit

Miscellany

public java v1 · immutable
·published 2006-12-08 14:35 UTC
rendered paste body
public class KodierungOffset {		public static void main(String[] args) {		final int NUM_LETTERS = 26;		String str = args[0];		int offset = Integer.parseInt(args[1]);				char[] encrypted = new char[str.length()];				for (int i = 0; i < str.length(); i++) {			char c = str.charAt(i);						if (c >= 'a' && c <= 'z')				c = (char)('a' + (((c - 'a') + offset) % NUM_LETTERS));			else if (c >= 'A' && c <= 'Z')				c = (char)('A' + (((c - 'A') + offset) % NUM_LETTERS));						encrypted[i] = c;		}		Out.println(encrypted);	}	}