8 Replies Latest reply on Sep 11, 2008 1:57 AM by c.pfaffenbichler

    removing multiple possible suffixes from linked files names js

    c.pfaffenbichler Level 8
      Good monday-morning!
      I work on a Script that relinks images with ones that have been separated according to other print-conditions and carry some suffix to indicate this; to get it to recognize the correct ones I need to remove potential existing suffixes ("_lay" for example but also signifiers for other separations) from the linked images names.
      I get this to work with either a series of »replaces« or a »for«-clause and an array of the possible suffixes, but Im only looking for a more elegant or simple way to do this in JavaScript.
      So what would in Your valued opinions be the most concise way to remove a host of possible letter-combinations from a String?

      Thanks for any advice
      pfaffenbichler