87 string splitting by separator, not whitespace

This commit is contained in:
survellow
2023-12-03 14:41:30 +01:00
parent a991e56115
commit ed99568fb1
7 changed files with 82 additions and 33 deletions

View File

@@ -27,7 +27,9 @@ func GetRooms(app *pocketbase.PocketBase) []string {
var roomArray []string
for _, event := range events {
var room = strings.Split(event.Rooms, " ")
var room = strings.FieldsFunc(event.Rooms, functions.IsSeparator(
[]rune{',', ' ', '\t', '\n', '\r', '\u00A0'},
))
//split functions room by space and add each room to array if it is not already in there
for _, r := range room {
var text = strings.TrimSpace(r)