From e85ebc6b31e187c4899fc62c0acf857929c73d06 Mon Sep 17 00:00:00 2001 From: Henrik Wallin <hedda@lysator.liu.se> Date: Thu, 8 Jul 1999 14:15:16 +0200 Subject: [PATCH] String.impode_nicely() uppdated to support array(string|float|int). Rev: tutorial/tutorial.wmml:1.123 --- tutorial/tutorial.wmml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tutorial/tutorial.wmml b/tutorial/tutorial.wmml index d1cf9a9da1..dcb257f8a2 100644 --- a/tutorial/tutorial.wmml +++ b/tutorial/tutorial.wmml @@ -5747,11 +5747,12 @@ Array.diff, Array.diff_compare_table, Array.diff_longest_sequence <function name=String.implode_nicely title="make an English comma separated list"> <man_syntax> -string implode_nicely(array(string) words, string|void separator); +string implode_nicely(array(string|float|int) words, string|void separator); </man_syntax> <man_description> This function implodes a list of words to a readable string. If the separator is omitted, the default is <tt>"and"</tt>. +If the words are numbers they are converet to strings first. </man_description> <man_example> > implode_nicely(({"green"}));<br> @@ -5762,6 +5763,8 @@ Result: green and blue<br> Result: green, blue and white<br> > implode_nicely(({"green","blue","white"}),"or");<br> Result: green, blue or white<br> +> implode_nicely(({1,2,3}),"or even");<br> +Result: 1, 2 or even 3<br> </man_example> <man_see> `* -- GitLab