Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

How to remove portion of the text from a given field?

Quote Reply
How to remove portion of the text from a given field?
Hello,


Say I have a category field called "Custom_Name" and the Custom_Name have the same prefix for each category say "prefix1_" for each subcategories.

I have different prefixes for different top categories.

How to declare a variable where I can define the prafix and then remove it form Custom_Name field.


I have a global called "substitute" which replaces space with underscore:

Code:

sub {

my $action = $_[0];

if ($action eq "underscore") {$_[1] =~ tr/ /_/; return $_[1]; }
else { return "Invalid action passed..."; }

}
then i call the global like this

Code:
<%substitute('underscore',$Custom_Name)%>

how to modify this to achieve what in I need?

Thanks in advance.
Subject Author Views Date
Thread How to remove portion of the text from a given field? AMIXIMA 3216 Mar 19, 2014, 10:31 AM
Post Re: [AMIXIMA] How to remove portion of the text from a given field?
Andy 3094 Mar 20, 2014, 12:50 AM