Gossamer Forum
Home : Products : Gossamer Links : Discussions :

remove / form string

Quote Reply
remove / form string
How I can remove form a string the "/" that is in the end of it
Example
Form "test/" to "test"
Quote Reply
Re: [nir] remove / form string In reply to
remove_end_slash
Code:
sub {
my $tmp = $_[0];
$tmp =~ s/\/$//;
return $tmp;
}

<%remove_end_slash($variable)%>

Replace $variable with the name of the tag you want to do this with :)

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!
Quote Reply
Re: [Andy] remove / form string In reply to
I have a small issue:)
If the URL is like this "site.com/test/123" and in the HTML code I insert <a href="."> it will point to "site.com/test/" is there a way that is point to "site.com/test" by using other code in the a href
Quote Reply
Re: [nir] remove / form string In reply to
Not sure what you mean? Please show me a proper example, and the HTML code you are using in the template :)

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!