- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
sub makeCleanString {
my ($self, $uncleanString) = @_;
$uncleanString = lc($uncleanString);
my @allowedChars = ("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", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "@", ".", " ");
my $cleanString = "";
# SPLIT THE uncleanString INTO AN ARRAY
my @usernameAR = split(//, $uncleanString);
my $usernameARcount = @usernameAR;
my $run=0;
for ($run=0;$run<$usernameARcount;$run++) {
if(grep $_ eq $usernameAR[$run], @allowedChars) {
$cleanString .= $usernameAR[$run];
}
}
return $cleanString;
}