summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
authorAlexander Fisher <alex@linfratech.co.uk>2015-07-06 17:03:49 +0100
committerDavid Schmitt <david.schmitt@puppetlabs.com>2015-07-09 18:13:19 +0100
commitc64ecfb0c39b633675269ab02f323f7eb486dad4 (patch)
tree111bfffe51ef0b0e5a743d23a30a6c8f0fe7b860 /README.markdown
parentf820bb156038f638d8e488286d0c2b92c5636925 (diff)
Add validate_slength's optional 3rd arg to README
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown4
1 files changed, 3 insertions, 1 deletions
diff --git a/README.markdown b/README.markdown
index 8ed3d9b..4dcdc2e 100644
--- a/README.markdown
+++ b/README.markdown
@@ -938,13 +938,14 @@ test, and the second argument should be a stringified regular expression (withou
#### `validate_slength`
-Validates that the first argument is a string (or an array of strings), and is less than or equal to the length of the second argument. It fails if the first argument is not a string or array of strings, or if arg 2 is not convertable to a number.
+Validates that the first argument is a string (or an array of strings), and is less than or equal to the length of the second argument. It fails if the first argument is not a string or array of strings, or if arg 2 is not convertable to a number. Optionally, a minimum string length can be given as the third argument.
The following values pass:
~~~
validate_slength("discombobulate",17)
validate_slength(["discombobulate","moo"],17)
+ validate_slength(["discombobulate","moo"],17,3)
~~~
The following values fail:
@@ -952,6 +953,7 @@ Validates that the first argument is a string (or an array of strings), and is l
~~~
validate_slength("discombobulate",1)
validate_slength(["discombobulate","thermometer"],5)
+ validate_slength(["discombobulate","moo"],17,10)
~~~
*Type*: statement.