get text after dash, get first line and get requested by
return str
}
+
+func getTextAfterDash(s string) string {
+ dashIndex := strings.Index(s, "-")
+ if dashIndex != -1 {
+ return strings.TrimSpace(s[dashIndex+1:])
+ }
+ return ""
+}
+
+func getFirstLine(s string) string {
+ lines := strings.SplitN(s, "\n", 2)
+ return lines[0]
+}
+
+func getRequestedBy(s string) string {
+ re := regexp.MustCompile(`(?i)Requested By:\s*(.*)`)
+ match := re.FindStringSubmatch(s)
+ if len(match) > 1 {
+ return strings.TrimSpace(match[1])
+ }
+ return "???"
+}