diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/markdown/Reference-manual.md | 11 | ||||
-rw-r--r-- | docs/markdown/snippets/pathdivision.md | 15 |
2 files changed, 25 insertions, 1 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index c9fe25b..f43f1f6 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -1005,7 +1005,7 @@ the jar with `java -jar file.jar`. ### join_paths() ``` meson - string join_paths(string1, string2, ...) +string join_paths(string1, string2, ...) ``` Joins the given strings into a file system path segment. For example @@ -1015,6 +1015,15 @@ dropped. That means that `join_paths('foo', '/bar')` returns `/bar`. *Added 0.36.0* +Since 0.49.0 using the`/` operator on strings is equivalent to calling +`join_paths`. + +```meson +# res1 and res2 will have identical values +res1 = join_paths(foo, bar) +res2 = foo / bar +``` + ### library() ``` meson diff --git a/docs/markdown/snippets/pathdivision.md b/docs/markdown/snippets/pathdivision.md new file mode 100644 index 0000000..6da6005 --- /dev/null +++ b/docs/markdown/snippets/pathdivision.md @@ -0,0 +1,15 @@ +## Joining paths with / + +Joining two paths has traditionally been done with the `join_paths` function. + +```meson +joined = join_paths('foo', 'bar') +``` + +Now you can use the simpler notation using the `/` operator. + +```meson +joined = 'foo' / 'bar' +``` + +This only works for strings. |