Function Updated 23 Oct 2026
isString(value, [minLength], [maxLength])
Validates that a value is text with at least minLength and at most maxLength characters. Numbers and other non-text values give false, and empty text or text with only white space always gives false. Alias: isStr.
Parameters
valueobjectrequiredValue to validate.
minLengthnumberoptionalMinimum number of characters (inclusive). Default is 1.
maxLengthnumberoptionalMaximum number of characters (inclusive). Default is no limit.
Returns
true if the value is text within the length limits, otherwise false.
Example
Normal JavaScript, running in the browser or on the Docly™ server.
let text = "testing";
if (docly.isString(text, 2)) write("String is 2 chars or more!\r");
if (docly.isString(text, 5)) write("String is 5 chars or more!\r");
if (docly.isString(text, 8)) write("String is 8 chars or more!\r");
if (!docly.isString(text, 1, 3)) write("String is not between 1 and 3 chars!\r");The JavaScript above produces this output:
String is 2 chars or more!
String is 5 chars or more!
String is not between 1 and 3 chars!