Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JOptionPane;
- public class Leetspeak {
- public static void main(String[] args) {
- String leet = JOptionPane.showInputDialog("Enter your message:").toLowerCase();
- char[] originals = {'a', 'b', 'c', 'e'};
- char[] replacements = {'4', '8', '(', '3'};
- for(int i = 0; i < originals.length; i++)
- leet = leet.replace(originals[i], replacements[i]);
- JOptionPane.showMessageDialog(null, leet);
- }
- }
Add Comment
Please, Sign In to add comment