docs/Writerside/topics/string.h.md

changeset 1582
32b82c424252
parent 1553
7c46531efd52
--- a/docs/Writerside/topics/string.h.md	Sat Dec 13 12:50:37 2025 +0100
+++ b/docs/Writerside/topics/string.h.md	Sat Dec 13 12:54:56 2025 +0100
@@ -74,10 +74,9 @@
 When you want to use a UCX string in a `printf`-like function, you can use the macro `CX_PRIstr` for the format specifier,
 and the `CX_SFMT(s)` macro to expand the arguments.
 
-> When you want to convert a string _literal_ into a UCX string, you can also use the `CX_STR(lit)` macro.
-> This macro uses the fact that `sizeof(lit)` for a string literal `lit` is always the string length plus one,
-> effectively saving an invocation of `strlen()`.
-> However, this only works for literals - in all other cases you must use `cx_str()` or `cx_strn`.
+> When you want to convert a string _literal_ into a UCX string, you can also use the `cx_str()` function.
+> With optimizations turned on, this function gets inlined and optimizes the call to `strlen()` out, giving
+> you a `cxstring` structure at zero cost with the length calculated at compile-time.
 
 ## Comparison
 
@@ -294,10 +293,10 @@
 cxstring str = cx_str("an,arbitrarily;||separated;string");
 
 // create the context
-CxStrtokCtx ctx = cx_strtok(str, CX_STR(","), 10);
+CxStrtokCtx ctx = cx_strtok(str, ",", 10);
 
 // add two more delimters
-cxstring delim_more[2] = {CX_STR("||"), CX_STR(";")};
+cxstring delim_more[2] = {cx_str("||"), cx_str(";")};
 cx_strtok_delim(&ctx, delim_more, 2);
 
 // iterate over the tokens

mercurial