Join a list of strings
ASPL 0.7.0 · Current release
Complete supplied source, preparation, and checked ASPL 0.7.0 outcomes.
On this page
Purpose and preparation
Browser and native, ASPL 0.7.0. Checks empty, single-element, and multi-element joins, then prints a,b,c with status 0.
See the current reference. No source module or external library is required.
Arabic source
This supplied complete source opens a new draft. Prepare the declared inputs/files in that draft, then select Run explicitly.
Execution: Browser and native · ASPL 0.7.0
- No prior knowledge is required to open and check it.
Input: No input lines are required.
دالة ابدأ_الرئيسية() -> ص64 {
دع فارغة: قائمة<نص> = [].
إذا (اجمع_نصوص(فارغة, ",") لا يطابق "") { أرجع 1. }
دع واحدة: قائمة<نص> = ["مرحبا"].
إذا (اجمع_نصوص(واحدة, ",") لا يطابق "مرحبا") { أرجع 2. }
دع أجزاء: قائمة<نص> = ["a", "b", "c"].
إذا (اجمع_نصوص(أجزاء, ",") لا يطابق "a,b,c") { أرجع 3. }
إذا (اجمع_نصوص(أجزاء, "") لا يطابق "abc") { أرجع 4. }
اطبع(اجمع_نصوص(أجزاء, ",")).
أرجع 0.
}
Expected outcomes
{
"browser": {
"check": "success",
"class": "success",
"output": "a,b,c",
"processStatus": 0
},
"native": {
"check": 0,
"status": 0,
"output": "a,b,c"
}
}English source
This supplied complete source opens a new draft. Prepare the declared inputs/files in that draft, then select Run explicitly.
Execution: Browser and native · ASPL 0.7.0
- No prior knowledge is required to open and check it.
Input: No input lines are required.
fn start_main() -> i64 {
let empty: list<string> = [];
if (join(empty, ",") not match "") { return 1; }
let one: list<string> = ["مرحبا"];
if (join(one, ",") not match "مرحبا") { return 2; }
let parts: list<string> = ["a", "b", "c"];
if (join(parts, ",") not match "a,b,c") { return 3; }
if (join(parts, "") not match "abc") { return 4; }
print(join(parts, ","));
return 0;
}
Expected outcomes
{
"browser": {
"check": "success",
"class": "success",
"output": "a,b,c",
"processStatus": 0
},
"native": {
"check": 0,
"status": 0,
"output": "a,b,c"
}
}Mixed source
This supplied complete source opens a new draft. Prepare the declared inputs/files in that draft, then select Run explicitly.
Execution: Browser and native · ASPL 0.7.0
- No prior knowledge is required to open and check it.
Input: No input lines are required.
fn ابدأ_الرئيسية() -> ص64 {
دع فارغة: قائمة<string> = [].
if (اجمع_نصوص(فارغة, ",") not match "") { return 1; }
دع واحدة: list<نص> = ["مرحبا"];
إذا (join(واحدة, ",") not match "مرحبا") { أرجع 2. }
let أجزاء: قائمة<string> = ["a", "b", "c"];
if (طول(أجزاء) not match 3) { return 3; }
إذا (اجمع_نصوص(أجزاء, ",") not match "a,b,c") { أرجع 4. }
if (join(أجزاء, "") not match "abc") { return 5; }
اطبع(join(أجزاء, ",")).
أرجع 0.
}
Expected outcomes
{
"browser": {
"check": "success",
"class": "success",
"output": "a,b,c",
"processStatus": 0
},
"native": {
"check": 0,
"status": 0,
"output": "a,b,c"
}
}Check the result
The source cards show the catalog's exact inputs and outcomes. Locale changes do not translate the supplied source. Download retains original source bytes.