// Join Example
/* Join concatenates strings */
var Words, Letters;
Words = new Array("Hello", "World");
Letters = new Array("D", "a", "l", "l", "a","s");
NSB.Print(Words.join(" ")+"!");
NSB.Print(Letters.join("_"));
No edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
Join returns a string that is created by concatenating a list of strings with an optional delimit character. The required argument, ''stringarray'', is a one-dimensional array of strings. The optional argument, ''delimiter'', is a string expression whose first character is used to separate the strings joined from ''stringarray''; if no string is provided a space character (" ") is used by default. To concantenate with no delimiters, use an empty space ("") as the delimiter. | Join returns a string that is created by concatenating a list of strings with an optional delimit character. The required argument, ''stringarray'', is a one-dimensional array of strings. The optional argument, ''delimiter'', is a string expression whose first character is used to separate the strings joined from ''stringarray''; if no string is provided a space character (" ") is used by default. To concantenate with no delimiters, use an empty space ("") as the delimiter. | ||
== Example | == Example == | ||
< | <tabber> | ||
JavaScript= | |||
<syntaxhighlight lang="JavaScript"> | |||
// Join Example | // Join Example | ||
/* Join concatenates strings */ | /* Join concatenates strings */ | ||
Line 27: | Line 18: | ||
NSB.Print(Words.join(" ")+"!"); | NSB.Print(Words.join(" ")+"!"); | ||
NSB.Print(Letters.join("_")); | NSB.Print(Letters.join("_")); | ||
</ | </syntaxhighlight> | ||
|-| | |||
BASIC= | |||
<syntaxhighlight lang="vb.net"> | |||
Rem Join Example | |||
'Join concatenates strings | |||
Dim Words, Letters | |||
Words = Array("Hello", "World") | |||
Letters = Array("D", "a", "l", "l", "a","s") | |||
Print Join(Words) & "!" | |||
Print Join(Letters, "_") | |||
</syntaxhighlight> | |||
</tabber> | |||
== Output == | == Output == | ||
Line 43: | Line 46: | ||
[[Category:Strings]] | [[Category:Strings]] | ||
[[Category:BASIC Functions]] |
Join(stringarray[, delimiter])
Join returns a string that is created by concatenating a list of strings with an optional delimit character. The required argument, stringarray, is a one-dimensional array of strings. The optional argument, delimiter, is a string expression whose first character is used to separate the strings joined from stringarray; if no string is provided a space character (" ") is used by default. To concantenate with no delimiters, use an empty space ("") as the delimiter.
// Join Example
/* Join concatenates strings */
var Words, Letters;
Words = new Array("Hello", "World");
Letters = new Array("D", "a", "l", "l", "a","s");
NSB.Print(Words.join(" ")+"!");
NSB.Print(Letters.join("_"));
Rem Join Example
'Join concatenates strings
Dim Words, Letters
Words = Array("Hello", "World")
Letters = Array("D", "a", "l", "l", "a","s")
Print Join(Words) & "!"
Print Join(Letters, "_")
Hello World! Dallas