Something like this?
my $test = q|delicia~~bevs~~golfer31~~nancy|;
my @new;
foreach (split /~~/, $test) {
next if $_ =~ /$player_to_remove/i;
push @new, $_;
}
my $new_users = join "~~", @new;
Basically just loop through the users you have, and skip if it matches the one you want to remove. Then re-join the strings and you have the new string without the one you removed :)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Code:
my $player_to_remove = "bevs"; my $test = q|delicia~~bevs~~golfer31~~nancy|;
my @new;
foreach (split /~~/, $test) {
next if $_ =~ /$player_to_remove/i;
push @new, $_;
}
my $new_users = join "~~", @new;
Basically just loop through the users you have, and skip if it matches the one you want to remove. Then re-join the strings and you have the new string without the one you removed :)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!