Specific wording in exception message for String methods.

This commit is contained in:
Ilya Gorbunov
2015-06-04 16:45:55 +03:00
parent a1d8e9d633
commit 009baa11fc
2 changed files with 6 additions and 6 deletions
@@ -91,7 +91,7 @@ fun filtering(): List<GenericFunction> {
doc(Strings) { "Returns a string containing the first [n] characters from this string, or the entire string if this string is shorter."}
body(Strings) {
"""
require(n >= 0, { "Requested element count $n is less than zero." })
require(n >= 0, { "Requested character count $n is less than zero." })
return substring(0, Math.min(n, length()))
"""
}
@@ -140,7 +140,7 @@ fun filtering(): List<GenericFunction> {
returns("String", Strings)
body(Strings) {
"""
require(n >= 0, { "Requested element count $n is less than zero." })
require(n >= 0, { "Requested character count $n is less than zero." })
return take((length() - n).coerceAtLeast(0))
"""
}
@@ -155,7 +155,7 @@ fun filtering(): List<GenericFunction> {
doc(Strings) { "Returns a string containing the last [n] characters from this string, or the entire string if this string is shorter."}
body(Strings) {
"""
require(n >= 0, { "Requested element count $n is less than zero." })
require(n >= 0, { "Requested character count $n is less than zero." })
val length = length()
return substring(length - Math.min(n, length), length)
"""