My goal is to return the first 30 characters of a user entered String and its returned in an email subject line.
My current solution is this:
Matcher matcher = Pattern.compile(".{1,30}").matcher(Item.getName());
String subject = this.subjectPrefix + "You have been assigned to Item Number " + Item.getId() + ": " + matcher + "...";
What is being returned for matcher is "java.util.regex.Matcher[pattern=.{1,30} region=0,28 lastmatch=]"