string.rst 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. string
  2. ------
  3. String operations.
  4. Synopsis
  5. ^^^^^^^^
  6. .. parsed-literal::
  7. `Search and Replace`_
  8. string(`FIND`_ <string> <substring> <out-var> [...])
  9. string(`REPLACE`_ <match-string> <replace-string> <out-var> <input>...)
  10. string(`REGEX MATCH`_ <match-regex> <out-var> <input>...)
  11. string(`REGEX MATCHALL`_ <match-regex> <out-var> <input>...)
  12. string(`REGEX REPLACE`_ <match-regex> <replace-expr> <out-var> <input>...)
  13. `Manipulation`_
  14. string(`APPEND`_ <string-var> [<input>...])
  15. string(`PREPEND`_ <string-var> [<input>...])
  16. string(`CONCAT`_ <out-var> [<input>...])
  17. string(`JOIN`_ <glue> <out-var> [<input>...])
  18. string(`TOLOWER`_ <string> <out-var>)
  19. string(`TOUPPER`_ <string> <out-var>)
  20. string(`LENGTH <LENGTH_>`_ <string> <out-var>)
  21. string(`SUBSTRING`_ <string> <begin> <length> <out-var>)
  22. string(`STRIP`_ <string> <out-var>)
  23. string(`GENEX_STRIP`_ <string> <out-var>)
  24. string(`REPEAT`_ <string> <count> <out-var>)
  25. string(`REGEX QUOTE`_ <out-var> <input>...)
  26. `Comparison`_
  27. string(`COMPARE`_ <op> <string1> <string2> <out-var>)
  28. `Hashing`_
  29. string(`\<HASH\>`_ <out-var> <input>)
  30. `Generation`_
  31. string(`ASCII`_ <number>... <out-var>)
  32. string(`HEX`_ <string> <out-var>)
  33. string(`CONFIGURE`_ <string> <out-var> [...])
  34. string(`MAKE_C_IDENTIFIER`_ <string> <out-var>)
  35. string(`RANDOM`_ [<option>...] <out-var>)
  36. string(`TIMESTAMP`_ <out-var> [<format string>] [UTC])
  37. string(`UUID`_ <out-var> ...)
  38. `JSON`_
  39. string(JSON <out-var> [ERROR_VARIABLE <error-var>]
  40. {`GET <JSON GET_>`_ | `TYPE <JSON TYPE_>`_ | `LENGTH <JSON LENGTH_>`_ | `REMOVE <JSON REMOVE_>`_}
  41. <json-string> <member|index> [<member|index> ...])
  42. string(JSON <out-var> [ERROR_VARIABLE <error-var>]
  43. `MEMBER <JSON MEMBER_>`_ <json-string>
  44. [<member|index> ...] <index>)
  45. string(JSON <out-var> [ERROR_VARIABLE <error-var>]
  46. `SET <JSON SET_>`_ <json-string>
  47. <member|index> [<member|index> ...] <value>)
  48. string(JSON <out-var> [ERROR_VARIABLE <error-var>]
  49. `EQUAL <JSON EQUAL_>`_ <json-string1> <json-string2>)
  50. Search and Replace
  51. ^^^^^^^^^^^^^^^^^^
  52. Search and Replace With Plain Strings
  53. """""""""""""""""""""""""""""""""""""
  54. .. signature::
  55. string(FIND <string> <substring> <output_variable> [REVERSE])
  56. Return the position where the given ``<substring>`` was found in
  57. the supplied ``<string>``. If the ``REVERSE`` flag was used, the command
  58. will search for the position of the last occurrence of the specified
  59. ``<substring>``. If the ``<substring>`` is not found, a position of -1 is
  60. returned.
  61. The ``string(FIND)`` subcommand treats all strings as ASCII-only characters.
  62. The index stored in ``<output_variable>`` will also be counted in bytes,
  63. so strings containing multi-byte characters may lead to unexpected results.
  64. .. signature::
  65. string(REPLACE <match_string>
  66. <replace_string> <output_variable>
  67. <input> [<input>...])
  68. Replace all occurrences of ``<match_string>`` in the ``<input>``
  69. with ``<replace_string>`` and store the result in the ``<output_variable>``.
  70. Search and Replace With Regular Expressions
  71. """""""""""""""""""""""""""""""""""""""""""
  72. .. signature::
  73. string(REGEX MATCH <regular_expression>
  74. <output_variable> <input> [<input>...])
  75. Match the ``<regular_expression>`` once and store the match in the
  76. ``<output_variable>``.
  77. All ``<input>`` arguments are concatenated before matching.
  78. Regular expressions are specified in the subsection just below.
  79. .. signature::
  80. string(REGEX MATCHALL <regular_expression>
  81. <output_variable> <input> [<input>...])
  82. Match the ``<regular_expression>`` as many times as possible and store the
  83. matches in the ``<output_variable>`` as a list.
  84. All ``<input>`` arguments are concatenated before matching.
  85. .. signature::
  86. string(REGEX REPLACE <regular_expression>
  87. <replacement_expression> <output_variable>
  88. <input> [<input>...])
  89. Match the ``<regular_expression>`` as many times as possible and substitute
  90. the ``<replacement_expression>`` for the match in the output.
  91. All ``<input>`` arguments are concatenated before matching.
  92. The ``<replacement_expression>`` may refer to parenthesis-delimited
  93. subexpressions of the match using ``\1``, ``\2``, ..., ``\9``. Note that
  94. two backslashes (``\\1``) are required in CMake code to get a backslash
  95. through argument parsing.
  96. .. versionchanged:: 4.1
  97. The ``^`` anchor now matches only at the beginning of the input
  98. string instead of the beginning of each repeated search.
  99. See policy :policy:`CMP0186`.
  100. Zero-length matches are allowed in ``MATCHALL`` and ``REPLACE``.
  101. Previously, they triggered an error.
  102. The replacement expression may contain references to subexpressions that
  103. didn't match anything. Previously, such references triggered an error.
  104. .. _`Regex Specification`:
  105. Regex Specification
  106. """""""""""""""""""
  107. The following characters have special meaning in regular expressions:
  108. ``^``
  109. Matches at beginning of input
  110. ``$``
  111. Matches at end of input
  112. ``.``
  113. Matches any single character
  114. ``\<char>``
  115. Matches the single character specified by ``<char>``. Use this to
  116. match special regex characters, e.g. ``\.`` for a literal ``.``
  117. or ``\\`` for a literal backslash ``\``. Escaping a non-special
  118. character is unnecessary but allowed, e.g. ``\a`` matches ``a``.
  119. ``[ ]``
  120. Matches any character(s) inside the brackets.
  121. To match a literal ``]``, make it the first character, e.g., ``[]ab]``.
  122. ``[^ ]``
  123. Matches any character(s) not inside the brackets.
  124. To not match a literal ``]``, make it the first character, e.g., ``[^]ab]``.
  125. ``-``
  126. Inside brackets, specifies an inclusive range between characters on
  127. either side, e.g., ``[a-f]`` is ``[abcdef]``.
  128. To match a literal ``-`` using brackets, make it the first or the last
  129. character, e.g., ``[+*/-]`` matches basic mathematical operators.
  130. ``*``
  131. Matches preceding pattern zero or more times
  132. ``+``
  133. Matches preceding pattern one or more times
  134. ``?``
  135. Matches preceding pattern zero or once only
  136. ``|``
  137. Matches a pattern on either side of the ``|``
  138. ``()``
  139. Saves a matched subexpression, which can be referenced
  140. in the ``REGEX REPLACE`` operation.
  141. .. versionadded:: 3.9
  142. All regular expression-related commands, including e.g.
  143. :command:`if(MATCHES)`, save subgroup matches in the variables
  144. :variable:`CMAKE_MATCH_<n>` for ``<n>`` 0..9.
  145. .. noqa: spellcheck off
  146. ``*``, ``+`` and ``?`` have higher precedence than concatenation. ``|``
  147. has lower precedence than concatenation. This means that the regular
  148. expression ``^ab+d$`` matches ``abbd`` but not ``ababd``, and the regular
  149. expression ``^(ab|cd)$`` matches ``ab`` but not ``abd``.
  150. .. noqa: spellcheck on
  151. CMake language :ref:`Escape Sequences` such as ``\t``, ``\r``, ``\n``,
  152. and ``\\`` may be used to construct literal tabs, carriage returns,
  153. newlines, and backslashes (respectively) to pass in a regex. For example:
  154. * The quoted argument ``"[ \t\r\n]"`` specifies a regex that matches
  155. any single whitespace character.
  156. * The quoted argument ``"[/\\]"`` specifies a regex that matches
  157. a single forward slash ``/`` or backslash ``\``.
  158. * The quoted argument ``"[A-Za-z0-9_]"`` specifies a regex that matches
  159. any single "word" character in the C locale.
  160. * The quoted argument ``"\\(\\a\\+b\\)"`` specifies a regex that matches
  161. the exact string ``(a+b)``. Each ``\\`` is parsed in a quoted argument
  162. as just ``\``, so the regex itself is actually ``\(\a\+\b\)``. This
  163. can alternatively be specified in a :ref:`bracket argument` without
  164. having to escape the backslashes, e.g. ``[[\(\a\+\b\)]]``.
  165. Manipulation
  166. ^^^^^^^^^^^^
  167. .. signature::
  168. string(APPEND <string_variable> [<input>...])
  169. .. versionadded:: 3.4
  170. Append all the ``<input>`` arguments to the string.
  171. .. signature::
  172. string(PREPEND <string_variable> [<input>...])
  173. .. versionadded:: 3.10
  174. Prepend all the ``<input>`` arguments to the string.
  175. .. signature::
  176. string(CONCAT <output_variable> [<input>...])
  177. Concatenate all the ``<input>`` arguments together and store
  178. the result in the named ``<output_variable>``.
  179. .. signature::
  180. string(JOIN <glue> <output_variable> [<input>...])
  181. .. versionadded:: 3.12
  182. Join all the ``<input>`` arguments together using the ``<glue>``
  183. string and store the result in the named ``<output_variable>``.
  184. To join a list's elements, prefer to use the ``JOIN`` operator
  185. from the :command:`list` command. This allows for the elements to have
  186. special characters like ``;`` in them.
  187. .. signature::
  188. string(TOLOWER <string> <output_variable>)
  189. Convert ``<string>`` to lower characters.
  190. .. signature::
  191. string(TOUPPER <string> <output_variable>)
  192. Convert ``<string>`` to upper characters.
  193. .. signature::
  194. string(LENGTH <string> <output_variable>)
  195. Store in an ``<output_variable>`` a given string's length in bytes.
  196. Note that this means if ``<string>`` contains multi-byte characters,
  197. the result stored in ``<output_variable>`` will *not* be
  198. the number of characters.
  199. .. signature::
  200. string(SUBSTRING <string> <begin> <length> <output_variable>)
  201. Store in an ``<output_variable>`` a substring of a given ``<string>``. If
  202. ``<length>`` is ``-1`` the remainder of the string starting at ``<begin>``
  203. will be returned.
  204. .. versionchanged:: 3.2
  205. If ``<string>`` is shorter than ``<length>``
  206. then the end of the string is used instead.
  207. Previous versions of CMake reported an error in this case.
  208. Both ``<begin>`` and ``<length>`` are counted in bytes, so care must
  209. be exercised if ``<string>`` could contain multi-byte characters.
  210. .. signature::
  211. string(STRIP <string> <output_variable>)
  212. Store in an ``<output_variable>`` a substring of a given ``<string>``
  213. with leading and trailing spaces removed.
  214. .. signature::
  215. string(GENEX_STRIP <string> <output_variable>)
  216. .. versionadded:: 3.1
  217. Strip any :manual:`generator expressions <cmake-generator-expressions(7)>`
  218. from the input ``<string>`` and store the result
  219. in the ``<output_variable>``.
  220. .. signature::
  221. string(REPEAT <string> <count> <output_variable>)
  222. .. versionadded:: 3.15
  223. Produce the output string as the input ``<string>``
  224. repeated ``<count>`` times.
  225. .. signature::
  226. string(REGEX QUOTE <out-var> <input>...)
  227. .. versionadded:: 4.2
  228. Store in an ``<out-var>`` a regular expression matching the ``<input>``.
  229. All characters that have special meaning in a regular expressions are
  230. escaped, such that the output string can be used as part of a regular
  231. expression to match the input literally.
  232. Comparison
  233. ^^^^^^^^^^
  234. .. _COMPARE:
  235. .. signature::
  236. string(COMPARE LESS <string1> <string2> <output_variable>)
  237. string(COMPARE GREATER <string1> <string2> <output_variable>)
  238. string(COMPARE EQUAL <string1> <string2> <output_variable>)
  239. string(COMPARE NOTEQUAL <string1> <string2> <output_variable>)
  240. string(COMPARE LESS_EQUAL <string1> <string2> <output_variable>)
  241. string(COMPARE GREATER_EQUAL <string1> <string2> <output_variable>)
  242. Compare the strings and store true or false in the ``<output_variable>``.
  243. .. versionadded:: 3.7
  244. Added the ``LESS_EQUAL`` and ``GREATER_EQUAL`` options.
  245. .. _`Supported Hash Algorithms`:
  246. Hashing
  247. ^^^^^^^
  248. .. signature::
  249. string(<HASH> <output_variable> <input>)
  250. :target: <HASH>
  251. Compute a cryptographic hash of the ``<input>`` string.
  252. The supported ``<HASH>`` algorithm names are:
  253. ``MD5``
  254. Message-Digest Algorithm 5, RFC 1321.
  255. ``SHA1``
  256. US Secure Hash Algorithm 1, RFC 3174.
  257. ``SHA224``
  258. US Secure Hash Algorithms, RFC 4634.
  259. ``SHA256``
  260. US Secure Hash Algorithms, RFC 4634.
  261. ``SHA384``
  262. US Secure Hash Algorithms, RFC 4634.
  263. ``SHA512``
  264. US Secure Hash Algorithms, RFC 4634.
  265. ``SHA3_224``
  266. Keccak SHA-3.
  267. ``SHA3_256``
  268. Keccak SHA-3.
  269. ``SHA3_384``
  270. Keccak SHA-3.
  271. ``SHA3_512``
  272. Keccak SHA-3.
  273. .. versionadded:: 3.8
  274. Added the ``SHA3_*`` hash algorithms.
  275. Generation
  276. ^^^^^^^^^^
  277. .. signature::
  278. string(ASCII <number> [<number> ...] <output_variable>)
  279. Convert all numbers into corresponding ASCII characters.
  280. .. signature::
  281. string(HEX <string> <output_variable>)
  282. .. versionadded:: 3.18
  283. Convert each byte in the input ``<string>`` to its hexadecimal representation
  284. and store the concatenated hex digits in the ``<output_variable>``.
  285. Letters in the output (``a`` through ``f``) are in lowercase.
  286. .. signature::
  287. string(CONFIGURE <string> <output_variable>
  288. [@ONLY] [ESCAPE_QUOTES])
  289. Transform a ``<string>`` like :command:`configure_file` transforms a file.
  290. .. signature::
  291. string(MAKE_C_IDENTIFIER <string> <output_variable>)
  292. Convert each non-alphanumeric character in the input ``<string>`` to an
  293. underscore and store the result in the ``<output_variable>``. If the first
  294. character of the ``<string>`` is a digit, an underscore will also be
  295. prepended to the result.
  296. .. signature::
  297. string(RANDOM [LENGTH <length>] [ALPHABET <alphabet>]
  298. [RANDOM_SEED <seed>] <output_variable>)
  299. Return a random string of given ``<length>`` consisting of
  300. characters from the given ``<alphabet>``. Default length is 5 characters
  301. and default alphabet is all numbers and upper and lower case letters.
  302. If an integer ``RANDOM_SEED`` is given, its value will be used to seed the
  303. random number generator.
  304. .. signature::
  305. string(TIMESTAMP <output_variable> [<format_string>] [UTC])
  306. Write a string representation of the current date
  307. and/or time to the ``<output_variable>``.
  308. If the command is unable to obtain a timestamp, the ``<output_variable>``
  309. will be set to the empty string ``""``.
  310. The optional ``UTC`` flag requests the current date/time representation to
  311. be in Coordinated Universal Time (UTC) rather than local time.
  312. The optional ``<format_string>`` may contain the following format
  313. specifiers:
  314. ``%%``
  315. .. versionadded:: 3.8
  316. A literal percent sign (%).
  317. ``%d``
  318. The day of the current month (01-31).
  319. ``%H``
  320. The hour on a 24-hour clock (00-23).
  321. ``%I``
  322. The hour on a 12-hour clock (01-12).
  323. ``%j``
  324. The day of the current year (001-366).
  325. ``%m``
  326. The month of the current year (01-12).
  327. ``%b``
  328. .. versionadded:: 3.7
  329. Abbreviated month name (e.g. Oct).
  330. ``%B``
  331. .. versionadded:: 3.10
  332. Full month name (e.g. October).
  333. ``%M``
  334. The minute of the current hour (00-59).
  335. ``%s``
  336. .. versionadded:: 3.6
  337. Seconds since midnight (UTC) 1-Jan-1970 (UNIX time).
  338. ``%S``
  339. The second of the current minute. 60 represents a leap second. (00-60)
  340. ``%f``
  341. .. versionadded:: 3.23
  342. The microsecond of the current second (000000-999999).
  343. ``%U``
  344. The week number of the current year (00-53).
  345. ``%V``
  346. .. versionadded:: 3.22
  347. The ISO 8601 week number of the current year (01-53).
  348. ``%w``
  349. The day of the current week. 0 is Sunday. (0-6)
  350. ``%a``
  351. .. versionadded:: 3.7
  352. Abbreviated weekday name (e.g. Fri).
  353. ``%A``
  354. .. versionadded:: 3.10
  355. Full weekday name (e.g. Friday).
  356. ``%y``
  357. The last two digits of the current year (00-99).
  358. ``%Y``
  359. The current year.
  360. ``%z``
  361. .. versionadded:: 3.26
  362. The offset of the time zone from UTC, in hours and minutes,
  363. with format ``+hhmm`` or ``-hhmm``.
  364. ``%Z``
  365. .. versionadded:: 3.26
  366. The time zone name.
  367. Unknown format specifiers will be ignored and copied to the output
  368. as-is.
  369. If no explicit ``<format_string>`` is given, it will default to:
  370. * ``%Y-%m-%dT%H:%M:%S`` for local time.
  371. * ``%Y-%m-%dT%H:%M:%SZ`` for UTC.
  372. .. versionadded:: 3.8
  373. If the ``SOURCE_DATE_EPOCH`` environment variable is set,
  374. its value will be used instead of the current time.
  375. See https://reproducible-builds.org/specs/source-date-epoch/ for details.
  376. .. signature::
  377. string(UUID <output_variable> NAMESPACE <namespace> NAME <name>
  378. TYPE <MD5|SHA1> [UPPER])
  379. .. versionadded:: 3.1
  380. Create a universally unique identifier (aka GUID) as per RFC4122
  381. based on the hash of the combined values of ``<namespace>``
  382. (which itself has to be a valid UUID) and ``<name>``.
  383. The hash algorithm can be either ``MD5`` (Version 3 UUID) or
  384. ``SHA1`` (Version 5 UUID).
  385. A UUID has the format ``xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx``
  386. where each ``x`` represents a lower case hexadecimal character.
  387. Where required, an uppercase representation can be requested
  388. with the optional ``UPPER`` flag.
  389. .. _JSON:
  390. JSON
  391. ^^^^
  392. .. versionadded:: 3.19
  393. Functionality for querying a JSON string.
  394. .. note::
  395. In each of the following JSON-related subcommands, if the optional
  396. ``ERROR_VARIABLE`` argument is given, errors will be reported in
  397. ``<error-variable>`` and the ``<out-var>`` will be set to
  398. ``<member|index>-[<member|index>...]-NOTFOUND`` with the path elements
  399. up to the point where the error occurred, or just ``NOTFOUND`` if there
  400. is no relevant path. If an error occurs but the ``ERROR_VARIABLE``
  401. option is not present, a fatal error message is generated. If no error
  402. occurs, the ``<error-variable>`` will be set to ``NOTFOUND``.
  403. In the following subcommands, the ``<json-string>`` argument should
  404. be written as a :ref:`Quoted Argument` to ensure the entire JSON
  405. string is passed as a single argument even if it contains semicolons.
  406. .. signature::
  407. string(JSON <out-var> [ERROR_VARIABLE <error-variable>]
  408. GET <json-string> <member|index> [<member|index> ...])
  409. :target: JSON GET
  410. Get an element from ``<json-string>`` at the location given
  411. by the list of ``<member|index>`` arguments.
  412. Array and object elements will be returned as a JSON string.
  413. Boolean elements will be returned as ``ON`` or ``OFF``.
  414. Null elements will be returned as an empty string.
  415. Number and string types will be returned as strings.
  416. .. signature::
  417. string(JSON <out-var> [ERROR_VARIABLE <error-variable>]
  418. TYPE <json-string> <member|index> [<member|index> ...])
  419. :target: JSON TYPE
  420. Get the type of an element in ``<json-string>`` at the location
  421. given by the list of ``<member|index>`` arguments. The ``<out-var>``
  422. will be set to one of ``NULL``, ``NUMBER``, ``STRING``, ``BOOLEAN``,
  423. ``ARRAY``, or ``OBJECT``.
  424. .. signature::
  425. string(JSON <out-var> [ERROR_VARIABLE <error-var>]
  426. MEMBER <json-string>
  427. [<member|index> ...] <index>)
  428. :target: JSON MEMBER
  429. Get the name of the ``<index>``-th member in ``<json-string>``
  430. at the location given by the list of ``<member|index>`` arguments.
  431. Requires an element of object type.
  432. .. signature::
  433. string(JSON <out-var> [ERROR_VARIABLE <error-variable>]
  434. LENGTH <json-string> [<member|index> ...])
  435. :target: JSON LENGTH
  436. Get the length of an element in ``<json-string>`` at the location
  437. given by the list of ``<member|index>`` arguments.
  438. Requires an element of array or object type.
  439. .. signature::
  440. string(JSON <out-var> [ERROR_VARIABLE <error-variable>]
  441. REMOVE <json-string> <member|index> [<member|index> ...])
  442. :target: JSON REMOVE
  443. Remove an element from ``<json-string>`` at the location
  444. given by the list of ``<member|index>`` arguments. The JSON string
  445. without the removed element will be stored in ``<out-var>``.
  446. .. signature::
  447. string(JSON <out-var> [ERROR_VARIABLE <error-variable>]
  448. SET <json-string> <member|index> [<member|index> ...] <value>)
  449. :target: JSON SET
  450. Set an element in ``<json-string>`` at the location
  451. given by the list of ``<member|index>`` arguments to ``<value>``.
  452. The contents of ``<value>`` should be valid JSON.
  453. If ``<json-string>`` is an array, ``<value>`` can be appended to the end of
  454. the array by using a number greater or equal to the array length as the
  455. ``<member|index>`` argument.
  456. .. signature::
  457. string(JSON <out-var> [ERROR_VARIABLE <error-var>]
  458. EQUAL <json-string1> <json-string2>)
  459. :target: JSON EQUAL
  460. Compare the two JSON objects given by ``<json-string1>``
  461. and ``<json-string2>`` for equality. The contents of ``<json-string1>``
  462. and ``<json-string2>`` should be valid JSON. The ``<out-var>``
  463. will be set to a true value if the JSON objects are considered equal,
  464. or a false value otherwise.