Используя обычный старый JavaScript :
var filename = "OUTsoundfile.123054236.123054236.wav";
var pieces = filename.split(".");
// pieces is an array that looks like this:
// ["OUTsoundfile", "123054236", "123054236", "wav"]
// Remove the last element from pieces, i.e. "wav"
// If you want to do anything with this last piece, such as check what the
// piece you removed was, use the return value of this statement.
pieces.pop();
// pieces now just looks like this:
// ["OUTsoundfile", "123054236", "123054236"]
// Put the string back together
var newFilename = pieces.join(".");
// newFilename is now this string: "OUTsoundfile.123054236.123054236"
Или, без комментариев:
var filename = "OUTsoundfile.123054236.123054236.wav";
var pieces = filename.split(".");
pieces.pop();
var newFilename = pieces.join(".");
Используйте фильтр 'contains', чтобы проверить, существует ли в строке .wav, а затем используйте подстроку для замены или удаления. – Maverick