{"id":781,"date":"2020-01-10T08:57:54","date_gmt":"2020-01-10T08:57:54","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/acr-rules\/reliability\/substring-function-invocation-should-make-sense\/"},"modified":"2020-03-20T08:44:58","modified_gmt":"2020-03-20T08:44:58","slug":"badsubstring","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/reliability\/badsubstring","title":{"rendered":"Substring function invocation should make sense"},"content":{"rendered":"\n<p style=\"text-align:center\">Introduced in version: 1.3 (29 Jan 2020)<\/p>\n\n\n\n<p>It is easy to make a mistake when invoking substring. This is almost certainly a bug.<\/p>\n\n\n\n<p><strong>Noncompliant examples:<\/strong><br><code>substring('test',0) -&gt; 'test'<br>substring('test',0,length('test')) -&gt; 'test'<br>substring('test',-1) -&gt; Error<br>substring('test',length('test')) -&gt; ''<br>substring('test', 15) -&gt; Error<br>substring('test', 2,15) -&gt; Error<\/code><\/p>\n\n\n\n<p><strong>Compliant examples:<\/strong><br><code>substring('thisismystring', 6) -&gt; 'mystring'<br>substring('mendixapp', 6,3) -&gt; 'app'<\/code><\/p>\n","protected":false},"featured_media":0,"parent":97,"menu_order":24,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-781","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/781"}],"collection":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=781"}],"version-history":[{"count":3,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/781\/revisions"}],"predecessor-version":[{"id":784,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/781\/revisions\/784"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/97"}],"next":[{"title":"System.User and System.Session objects should not be created directly","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/reliability\/createsystementity","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/277"}],"prev":[{"title":"Short-circuit logic should be used correctly to prevent null pointer dereferences in conditionals","link":"https:\/\/sdf-docs.clevr.com\/?docs=acr-rules\/reliability\/shortcircuit","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/785"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=781"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}