isString(value, [minLength], [maxLength]) Last updated: 23. Oct 2026

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.

See also: isInteger isNumber isName Example: Create custom API functions Example: Save data to Docly from API-function

Parameters

Name Type Description
value object

Value to validate.

minLength (optional) number

Minimum number of characters (inclusive). Default is 1.

maxLength (optional) number

Maximum number of characters (inclusive). Default is no limit.

Returns

true if the value is text within the length limits, otherwise false.

Example

Code example (JS)

JS is normal JavaScript either 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");

Output

The JS code above produces the output shown below:
String is 2 chars or more!
String is 5 chars or more!
String is not between 1 and 3 chars!