From d93d01b6c5c98a77e057b914e8d66b01d2a10771 Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Wed, 1 Sep 2021 23:18:28 +0200 Subject: interpreter: Introduce StringHolder Another commit in my quest to rid InterpreterBase from all higher level object processing logic. Additionally, there is a a logic change here, since `str.join` now uses varargs and can now accept more than one argument (and supports list flattening). --- docs/markdown/Reference-manual.md | 1 + docs/markdown/snippets/str_join.md | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 docs/markdown/snippets/str_join.md (limited to 'docs/markdown') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 8ef36de..31ed77e 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -2268,6 +2268,7 @@ are immutable, all operations return their results as a new string. - `join(list_of_strings)`: the opposite of split, for example `'.'.join(['a', 'b', 'c']` yields `'a.b.c'`. + *(Since 0.60.0)* more than one argument is supported and lists will be flattened. - `replace('old_substr', 'new_str')` *(since 0.58.0)*: replaces instances of `old_substr` in the string with `new_str` and returns a new string diff --git a/docs/markdown/snippets/str_join.md b/docs/markdown/snippets/str_join.md new file mode 100644 index 0000000..b430d66 --- /dev/null +++ b/docs/markdown/snippets/str_join.md @@ -0,0 +1,5 @@ +## Relax restrictions of `str.join()` + +Since 0.60.0, the [[str.join]] method can take an arbitrary number of arguments +instead of just one list. Additionally, all lists past to [[str.join]] will now +be flattened. -- cgit v1.1