partial implementation of community profile page - next, straighten out left menus

This commit is contained in:
2025-10-15 23:20:43 -06:00
parent 0a8f67c676
commit 681b30272d
12 changed files with 915 additions and 8 deletions
+24 -1
View File
@@ -10,7 +10,20 @@
// Package util contains utility definitions.
package util
import "unicode"
import (
"regexp"
"unicode"
)
var numeric *regexp.Regexp
func init() {
re, err := regexp.Compile("^[0-9]+$")
if err != nil {
panic(err)
}
numeric = re
}
/* CapitalizeString changes the first character of the string to a capital.
* Parameters:
@@ -26,3 +39,13 @@ func CapitalizeString(s string) string {
}
return ""
}
/* IsNumeric returns true if the string is numeric (all digits).
* Parameters:
* s - String to be tested.
* Returns:
* true if string is numeric, false if not.
*/
func IsNumeric(s string) bool {
return numeric.MatchString(s)
}