Slight adjustment to TitleCase

This commit is contained in:
Patrick O'brien 2016-08-22 15:10:15 +10:00
parent c4526d4d2c
commit 604fbea7de

View file

@ -167,17 +167,17 @@ func TitleCase(n string) string {
for start < ln { for start < ln {
// Find the start and end of the underscores to account // Find the start and end of the underscores to account
// for the possibility of being multiple underscores in a row. // for the possibility of being multiple underscores in a row.
if end < ln && name[start] == '_' { if end < ln {
start++ if name[start] == '_' {
end++ start++
continue end++
} continue
// Once we have found the end of the underscores, we can
// Once we have found the end of the underscores, we can // find the end of the first full word.
// find the end of the first full word. } else if name[end] != '_' {
if end < ln && name[end] != '_' { end++
end++ continue
continue }
} }
word := name[start:end] word := name[start:end]