Test whether a string is a signed integer.

SolidGroundUX DocumentationSolidGroundUX
NL

fn: sgnd_validate_int

Purpose

Test whether a string is a signed integer.

Arguments

  • $1 — Candidate value.

Returns

  • 0 for an optional minus sign followed by digits; 1 otherwise.

Usage

  sgnd_validate_int "-42"