How To Filter A String

Posted by Siert on July 15, 2008, 9:26 p.m.

//starts arguments

var fstring, caps, offensive, filtered;

fstring=argument0

//creates list of offensive words

offensive = ds_list_create()

This is where the offensive words are added.

Example:

ds_list_add(offensive,"wth")

Add as many as you want.

To see my list and save some time, click here.

Save other people some time and your words there!

//save capital positions

caps=ds_list_create()

global.caps = caps

for(p=1; p<=string_length(k); p+=1){

if string_char_at(fstring,p)=string_letters(string_upper(string_char_at(fstring,p)))

ds_list_add(caps,p)}

//save symbol positions

symbpos=ds_list_create()

global.symbpos = symbpos

symb=ds_list_create()

global.symb = symb

for(p=1; p<=string_length(fstring); p+=1){

if string_char_at(fstring,p)!=string_letters(string_char_at(fstring,p)){

ds_list_add(symb,string_char_at(fstring,p))

ds_list_add(symbpos,p)}}

//replaces symbols with possible letter counterparts

fstring=string_replace_all(fstring,'1','i')

fstring=string_replace_all(fstring,'!','i')

fstring=string_replace_all(fstring,'3','e')

fstring=string_replace_all(fstring,'5','s')

fstring=string_replace_all(fstring,'8','b')

fstring=string_replace_all(fstring,'0','o')

fstring=string_replace_all(fstring,'()','o')

fstring=string_replace_all(fstring,'@','a')

fstring=string_replace_all(fstring,'$','s')

fstring=string_replace_all(fstring,'z','s')

//make string lowercase

fstring = string_lower(fstring)

//stars out bad words

var star;

star=''

for(ds=0; ds<ds_list_size(offensive); ds+=1){

star=''

//generates string of correct number of stars

for(a=0; a<string_length(ds_list_find_value(offensive,ds)); a+=1)

star+='*'

fstring = string_replace_all(fstring,ds_list_find_value(offensive,ds),star)}

//puts stars the original string with numbers and symbols

for(l=1; l<=string_length(fstring)+1; l+=1){

if string_char_at(fstring,l)='*'{

filtered = string_delete(filtered,l,1)

filtered = string_insert('*',filtered,l)}}

//returns a filtered string

return filtered

I'm pretty sure that counts as content.

Go filter your games!

Hey! Add words to the list here!

EDIT: God is included because I don't want people going "God Damnit" every where. Which IS offensive to me because I AM a Christian!

STOP THE FLAMES!

And Arc, WHY does my filtering fail?

Comments

Alert Games 16 years, 3 months ago

i think those should be off because sometimes they can be used for things like "coloraze_god" or something like that.

also, handjob is on there twice, and so is god, and tit could be in other words… u know

Arcalyth 16 years, 3 months ago

Quote:
you will probley get reported
Haha, reported to who? The Jesus Police?

Anyway, regex is more effective.

SixWinged 16 years, 3 months ago

Titanium Alloy.

PY 16 years, 3 months ago

lmao, Arc.

@DT, I think so What Christian Offendisve No Normal Offended Christian Person No Should Be.

Also, coloraSe level name: Jesus Christ, For Gods Sake! is more likely to be offensive. Please speak this 'English' thing.

eagly 16 years, 3 months ago

Oral? Offensive? What if someone is prescribing drugs and they say "You must take it orally." Then the patient will be like WHAT DID YOU SAY I CAN'T SEE and then die because they didn't get their drugs and then their family will sue you for damages and then you will go out of business and become bankrupt and live in a gutter on the road and maybe get eaten by coyotes pretending to be a group of kids who want to party because a pack of coyotes sounds like children laughing and I know this because beam told me and also coyotes look devious so it doesn't surprise me.

*breathes*

OK bye.

PY 16 years, 3 months ago

s 16 years, 3 months ago

I'd say a three letter acronym at eagly's story, but I'm afraid it is censored

biggoron 16 years, 3 months ago

I find Siert's code formatting offensive, please censor it.

DSG 16 years, 3 months ago

Here's something to censor:

Censorship is for the weak. I dispise it. And as for religion I find any religious belief offensive; both to me and to the collective intellegence of the human race. I say that not be be an asshole however, but to challenge a taboo.

:D

DSG 16 years, 3 months ago

Not that I care about it really. Frankly I don;t give a flying fcuk about things like religion or politics. I hate everyone and everything.