#1 : 30/03-19 05:03 Coty
Posts: 1
|
I'm trying to write a script to end the filename after a specific character, ")" in this case, but I haven't written Java in over 10 years.. Anyone willing to assist?
|
#2 : 30/03-19 09:15 David Lee
Posts: 1125
|
You don't need to use scripting - a Replace method with a Regular Expression will achieve this.
Replace: (.*?\))(.*) with: \1 This will truncate the filename after the first occurrence of ")" If you omit the "?" then the first "*" quantifier will be "greedy" and a filename containing more than one ")" will be truncated after the final ")". |