Files
wehub-resource-sync ead81af521
Deploy to GitHub Pages / deploy (push) Failing after 0s
CI / go (push) Has been cancelled
CI / build (darwin, macos-14) (push) Has been cancelled
CI / build (windows, windows-2025) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:31:13 +08:00

13 lines
264 B
Go

package model
import "unicode/utf8"
// removeLastRune trims the final UTF-8 rune from s, used by all text input handlers.
func removeLastRune(s string) string {
if len(s) > 0 {
_, size := utf8.DecodeLastRuneInString(s)
return s[:len(s)-size]
}
return s
}