A
Alexander Stremitzer
I want to be able to break a string into 2 parts. One part should be
everything before "/", the second one everything after "/" or empty if
there is no "/".
Here is some sample input data and what I would expect.
"SKULL"
"SKULL",""
"SKULL /LEFT"
"SKULL","LEFT"
"SKULL /FULL /LEFT"
"SKULL","FULL /LEFT"
I have tried with pattern matching but can't get it to work. Any help is
appreciated.
$full_desc = "SKULL";
$full_desc =~ m/(\w*)\/(\w*)/;
print "string1: $1\n";
print "string2: $2\n";
everything before "/", the second one everything after "/" or empty if
there is no "/".
Here is some sample input data and what I would expect.
"SKULL"
"SKULL",""
"SKULL /LEFT"
"SKULL","LEFT"
"SKULL /FULL /LEFT"
"SKULL","FULL /LEFT"
I have tried with pattern matching but can't get it to work. Any help is
appreciated.
$full_desc = "SKULL";
$full_desc =~ m/(\w*)\/(\w*)/;
print "string1: $1\n";
print "string2: $2\n";