Penyaring Kata

Hanya sekedar iseng, dikasi kuis-kuisan dari teman yang baik hati itu. Seperti biasa, mau dibuang kok sayang. Ya udah, di-post di sini aja.

https://gist.github.com/erricgunawan/731002a99311ed500dd1.js

Dan ini hasilnya kalau dijalankan via browser:

input = the quick brown fox jumps over the lazy dog

filter = Array
(
[0] => the
[1] => brown
[2] => lazy
)

replace = Array
(
[0] => t**
[1] => b****
[2] => l***
)

output = t** quick b**** fox jumps over t** l*** dog

Cukup sederhana.
Tapi kadang yang sederhana pun, bisa bikin pusing kalau memang tidak tahu 😉

Semoga ada yang terbantu.

Published by Eric Gunawan

Happiness Engineer. WordPress Ambassador. Remote Worker. Soccer News Follower. Movie Lover. Proud Father. Lucky Husband.

One thought on “Penyaring Kata

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: