validate

Validates an Indian mobile number.

Input normalisation applied before validation (in order):

  1. Trim leading/trailing whitespace

  2. Strip +91 prefix (if present)

  3. Strip a single leading 0 (if present after step 2)

  4. Strip all remaining spaces and hyphens

After normalisation, checks are applied in this order — first failing check wins:

Edge cases:

Return

ValidationResult.Valid if the number is a valid 10-digit Indian mobile, ValidationResult.Invalid with an appropriate InvalidReason otherwise.

Parameters

value

Raw mobile number string in any common Indian format.

Samples

check(Mobile.validate("9876543210") == ValidationResult.Valid)
check(Mobile.validate("+91 98765 43210") == ValidationResult.Valid)