segosa
Community's Choice
Posts: 1407 Reputation: 92
Joined: Feb 2003
|
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
Here's code which will replace the letters for you. Might be a bit buggy as I didn't do extensive testing, however it works.
code: function fuck_up_string(str)
{
var a = [ 'a','B','C','D','e','F','G','H','i','J','K','L','M','N','o','P','Q','R','S','T','u','V','W','X','Y','Z' ];
var o = "", c;
str = str.toLowerCase();
for (var i = 0; i < str.length; i++)
{
c = str.charCodeAt( i );
if (c >= 97 && c <= 122)
o += a[c - 97];
else o += str.charAt( i );
}
return o;
}
You see that?
code: var a = [ 'a','B','C','D','e','F','G','H','i','J','K','L','M','N','o','P','Q','R','S','T','u','V','W','X','Y','Z' ];
It will replace the letters a to z with the contents of that. As you can see in my testing I simply made the vowels lowercase. If I sent a message like "this is a test" I got "THiS iS a TeST".
This post was edited on 07-12-2006 at 09:51 PM by segosa.
The previous sentence is false. The following sentence is true.
|
|