ACR Rules

  1. Home
  2. Docs
  3. ACR Rules
  4. Reliability (41)
  5. Substring function invocation should make sense

Substring function invocation should make sense

Introduced in version: 1.3 (29 Jan 2020)

It is easy to make a mistake when invoking substring. This is almost certainly a bug.

Noncompliant examples:
substring('test',0) -> 'test'
substring('test',0,length('test')) -> 'test'
substring('test',-1) -> Error
substring('test',length('test')) -> ''
substring('test', 15) -> Error
substring('test', 2,15) -> Error

Compliant examples:
substring('thisismystring', 6) -> 'mystring'
substring('mendixapp', 6,3) -> 'app'