Slight adjustment to TitleCase
This commit is contained in:
parent
c4526d4d2c
commit
604fbea7de
1 changed files with 11 additions and 11 deletions
|
@ -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]
|
||||||
|
|
Loading…
Add table
Reference in a new issue