Hello,
I'm trying to perform a substring on a string variable. I want to extract a part of the string till a specific character is found within the string.(the pipe character '|' in this case)
Currently, I'm using the index function to supply the Length argument:
my $cd = substr($_, 0, index($_,"|"
);
Is there any other way to implement this?
Thanks!
I'm trying to perform a substring on a string variable. I want to extract a part of the string till a specific character is found within the string.(the pipe character '|' in this case)
Currently, I'm using the index function to supply the Length argument:
my $cd = substr($_, 0, index($_,"|"
Is there any other way to implement this?
Thanks!