Join: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(Created page with "JOIN(''stringarray''[, ''delimiter'']) '''Description''' JOIN returns a string that is created by concatenating a list of strings with an optional delimit character. The req...")
 
No edit summary
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
JOIN(''stringarray''[, ''delimiter''])
Join(''stringarray''[, ''delimiter''])


'''Description'''
== Description ==


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 ==


<pre>
<tabber>
REM JOIN Example
JavaScript=
'JOIN concatenates strings
<syntaxhighlight lang="JavaScript">
DIM Words, Letters
// Join Example
Words = ARRAY("Hello", "World")
/* Join concatenates strings */
Letters = ARRAY("D", "a", "l", "l", "a","s")
 
PRINT JOIN(Words) & "!"
var Words, Letters;
PRINT JOIN(Letters, "_")
Words = new Array("Hello", "World");
</pre>
Letters = new Array("D", "a", "l", "l", "a","s");
NSB.Print(Words.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 ==


<pre>
<pre>
Line 24: Line 39:
</pre>
</pre>


'''Related Items'''
== Related Items ==
 
[[split|Split]]
 
[[Category:Language Reference]]
 
[[Category:Strings]]


[[split|SPLIT]]
[[Category:BASIC Functions]]

Latest revision as of 16:15, 24 July 2019

Join(stringarray[, delimiter])

Description

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

// 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, "_")

Output

Hello World!
Dallas

Related Items

Split