String.Contains() not wot working

Alistair DeJonge asked on March 2, 2017 18:38

I am trying to use String.Contains(URL,"http"), but it is not working. The event log is showing an error saying:

Method 'Contains' for object of type 'CMS.MacroEngine.StringNamespace' not found, please check the macro or the method declaration.

Yet this macro is on the Macro Reference page of the documentation: https://docs.kentico.com/k9/macro-expressions/reference-macro-methods#Reference-Macromethods-Textmanipulation

Correct Answer

Zach Perry answered on March 2, 2017 18:46

use {% Contains(URL,"http") %}

3 votesVote for this answer Unmark Correct answer

Recent Answers


Alistair DeJonge answered on March 2, 2017 18:49

Thank you, that worked.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.