KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Using % to Check if a String Contains a Specific Word in 4D
PRODUCT: 4D | VERSION: 20 R | PLATFORM: Mac & Win
Published On: May 9, 2025

In 4D, the % operator lets you check if one string contains a word.

$str:="Hello community, I want to confirm if a string contains a specific word. How can I do that?"
$str_contains:=$str%"specific"

The % operator is case-insensitive by default — so "SPECIFIC", "Specific", or "specific" all match.