fauxLeet - str1(str1==char'e)=char'3...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function char_vec = fauxLeet(str1) %function to recreate leet speak where % l -> 1 % e -> 3 % o -> 0 % t -> 7 % s -> 5 % a -> @ % k -> x %and all of the rest of the letters are lowercase %usage: char_vec = fauxLeet(str1) x = str1>='A' & str1 %finds all of the capital letters in str1 in order to select only those %letters to be made lowercase str1(x) = str1(x) + 'a' - 'A'; %this will take the capital letters from str1 and add 32 (which is the %distance between the lowercase and uppercase letters on the ACSII table str1(str1==char('l'))=char('1');
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: str1(str1==char('e'))=char('3'); str1(str1==char('o'))=char('0'); str1(str1==char('t'))=char('7'); str1(str1==char('s'))=char('5'); str1(str1==char('a'))=char('@'); str1(str1==char('k'))=char('x'); %the lines of code above will replace the corresponding characters found in %str1 and replace them with the characters according to the leet speak; we %must index which characters we wish to replace and then set them equal to %the desired characters char_vec = str1; end...
View Full Document

This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Tech.

Ask a homework question - tutors are online