Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 466 Bytes

NoWhitespace.md

File metadata and controls

19 lines (13 loc) · 466 Bytes

NoWhitespace

  • v::noWhitespace()

Validates if a string contains no whitespace (spaces, tabs and line breaks);

v::noWhitespace()->validate('foo bar');  //false
v::noWhitespace()->validate("foo\nbar"); //false

Like other rules the input is still optional.

v::string()->noWhitespace()->validate('');  //true
v::string()->noWhitespace()->validate(' '); //false

This is most useful when chaining with other validators such as v::alnum()