summaryrefslogtreecommitdiff
path: root/src/pkg/strings/strings.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2009-09-01 13:46:59 -0700
committerRob Pike <r@golang.org>2009-09-01 13:46:59 -0700
commitd504196b95d2f87f4796b32148579955a3f2caf2 (patch)
treed4b6e571edb2c10b0dbe9341187850fa899a7699 /src/pkg/strings/strings.go
parenta9fec6c6215fb66ec448c996278026436639baca (diff)
downloadgolang-d504196b95d2f87f4796b32148579955a3f2caf2.tar.gz
casing operations for byte arrays
R=rsc DELTA=186 (181 added, 0 deleted, 5 changed) OCL=34203 CL=34203
Diffstat (limited to 'src/pkg/strings/strings.go')
-rw-r--r--src/pkg/strings/strings.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/strings/strings.go b/src/pkg/strings/strings.go
index eaa6a71a1..f0f076157 100644
--- a/src/pkg/strings/strings.go
+++ b/src/pkg/strings/strings.go
@@ -149,7 +149,7 @@ func HasSuffix(s, suffix string) bool {
}
// Map returns a copy of the string s with all its characters modified
-// according to mapping function.
+// according to the mapping function.
func Map(mapping func(rune int) int, s string) string {
// In the worst case, the string can grow when mapped, making
// things unpleasant. But it's so rare we barge in assuming it's
@@ -177,17 +177,17 @@ func Map(mapping func(rune int) int, s string) string {
return string(b[0:nbytes]);
}
-// ToUpper returns a copy of the string s with all letters mapped to their upper case.
+// ToUpper returns a copy of the string s with all Unicode letters mapped to their upper case.
func ToUpper(s string) string {
return Map(unicode.ToUpper, s)
}
-// ToUpper returns a copy of the string s with all letters mapped to their lower case.
+// ToUpper returns a copy of the string s with all Unicode letters mapped to their lower case.
func ToLower(s string) string {
return Map(unicode.ToLower, s)
}
-// ToTitle returns a copy of the string s with all letters mapped to their title case.
+// ToTitle returns a copy of the string s with all Unicode letters mapped to their title case.
func Title(s string) string {
return Map(unicode.ToTitle, s)
}