diff --git a/source/net/filebot/format/ExpressionFormatMethods.java b/source/net/filebot/format/ExpressionFormatMethods.java index ddd44a98..7c189e86 100644 --- a/source/net/filebot/format/ExpressionFormatMethods.java +++ b/source/net/filebot/format/ExpressionFormatMethods.java @@ -8,6 +8,7 @@ import static net.filebot.WebServices.*; import static net.filebot.format.ExpressionFormatFunctions.*; import static net.filebot.media.MediaDetection.*; import static net.filebot.util.RegularExpressions.*; +import static net.filebot.util.StringUtilities.*; import java.io.File; import java.io.IOException; @@ -227,6 +228,14 @@ public class ExpressionFormatMethods { return compile("^(The|A|An)\\s(.+)", CASE_INSENSITIVE | UNICODE_CHARACTER_CLASS).matcher(self).replaceFirst(replacement).trim(); } + public static String initialName(String self) { + String[] words = SPACE.split(self); + for (int i = 0; i < words.length - 1; i++) { + words[i] = words[i].charAt(0) + "."; + } + return join(words, " "); + } + public static String sortInitial(String self) { // use primary initial, ignore The XY, A XY, etc char c = ascii(sortName(self)).charAt(0);