task_url stringlengths 30 116 | task_name stringlengths 2 86 | task_description stringlengths 0 14.4k | language_url stringlengths 2 53 | language_name stringlengths 1 52 | code stringlengths 0 61.9k |
|---|---|---|---|---|---|
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Scheme | Scheme | ; in r5rs, there is append for lists, but we'll need to define vector-append
(define (vector-append . arg) (list->vector (apply append (map vector->list arg))))
(vector-append #(1 2 3 4) #(5 6 7) #(8 9 10))
; #(1 2 3 4 5 6 7 8 9 10) |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Seed7 | Seed7 | $ include "seed7_05.s7i";
var array integer: a is [] (1, 2, 3, 4);
var array integer: b is [] (5, 6, 7, 8);
var array integer: c is [] (9, 10);
const proc: main is func
local
var integer: number is 0;
begin
c := a & b;
for number range c do
write(number <& " ");
end for;
writeln;
end... |
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #J | J | require'strings'
soul=: -. {.
normalize=: [:soul' ',dltb;._2
mask=: 0: _1} '+' = {.
partition=: '|' = mask #"1 soul
labels=: ;@(([: <@}: <@dltb;._1)"1~ '|'&=)@soul
names=: ;:^:(0 = L.)
unpacker=:1 :0
p=. , partition normalize m
p #.;.1 (8#2) ,@:#: ]
)
packer=:1 :0
w=. -#;.1 ,partition normalize m
_8 (#.... |
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Java | Java |
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class AsciiArtDiagramConverter {
private static final String TEST = "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\r\n" +
"| ID ... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #SenseTalk | SenseTalk | put (1, 2, 3) into list1
put (4, 5, 6) into list2
put list1 &&& list2 into list3
put list3 |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #SETL | SETL | A := [1, 2, 3];
B := [3, 4, 5];
print(A + B); -- [1 2 3 3 4 5] |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #11l | 11l | print([‘apple’, ‘orange’].len) |
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #JavaScript | JavaScript | // ------------------------------------------------------------[ Boilerplate ]--
const trimWhitespace = s => s.trim();
const isNotEmpty = s => s !== '';
const stringLength = s => s.length;
const hexToBin4 = s => parseInt(s, 16).toString(2).padStart(4, '0');
const concatHexToBin = (binStr, hexStr) => binStr.concat('', h... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Sidef | Sidef | var arr1 = [1, 2, 3];
var arr2 = [4, 5, 6];
var arr3 = (arr1 + arr2); # => [1, 2, 3, 4, 5, 6] |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Simula | Simula | BEGIN ! Concatenate arrays - of REAL, here;
CLASS REAL_ARRAY(N); INTEGER N;
BEGIN
REAL ARRAY DATA(1:N);
! Return a new REAL_ARRAY containing
! the values from this REAL_ARRAY
! followed by the values from other;
REF(REAL_ARRAY) PROCEDURE CONCAT(other);
R... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #360_Assembly | 360 Assembly | * Array length 22/02/2017
ARRAYLEN START
USING ARRAYLEN,12
LR 12,15 end of prolog
LA 1,(AEND-A)/L'A hbound(a)
XDECO 1,PG+13 edit
XPRNT PG,L'PG print
BR 14 exit
A DC CL... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #6502_Assembly | 6502 Assembly | start:
LDA #(Array_End-Array) ;evaluates to 13
RTS
Array:
byte "apple",0
byte "orange",0
Array_End: |
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Julia | Julia | diagram = """
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RCODE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ... |
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Lua | Lua | local function validate(diagram)
local lines = {}
for s in diagram:gmatch("[^\r\n]+") do
s = s:match("^%s*(.-)%s*$")
if s~="" then lines[#lines+1]=s end
end
-- "a little of validation".."for brevity"
assert(#lines>0, "FAIL: no non-empty lines")
assert(#lines%2==1, "FAIL: even number of lines")
r... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Slate | Slate |
{1. 2. 3. 4. 5} ; {6. 7. 8. 9. 10}
|
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Smalltalk | Smalltalk | |a b c|
a := #(1 2 3 4 5).
b := #(6 7 8 9 10).
c := a,b.
c displayNl. |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #68000_Assembly | 68000 Assembly | start:
MOVE.B #(Array_End-Array) ;evaluates to 14
RTS
Array:
DC.B "apple",0
even
DC.B "orange",0
even
Array_End: |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #8th | 8th |
["apples", "oranges"] a:len . cr
|
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Nim | Nim | import macros
import strutils
import tables
const Diagram = """
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RCODE |
+--+--+--... |
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Ol | Ol |
(import (owl parse))
(define format "
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RCODE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QDCOUNT... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #SNOBOL4 | SNOBOL4 | * # Concatenate 2 arrays (vectors)
define('cat(a1,a2)i,j') :(cat_end)
cat cat = array(prototype(a1) + prototype(a2))
cat1 i = i + 1; cat<i> = a1<i> :s(cat1)
cat2 j = j + 1; cat<i - 1 + j> = a2<j> :s(cat2)f(return)
cat_end
* # Fill arrays
str1 = '1 2 3 4 5'; arr1 = array(5)
loop ... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Standard_ML | Standard ML |
val l1 = [1,2,3,4];;
val l2 = [5,6,7,8];;
val l3 = l1 @ l2 (* [1,2,3,4,5,6,7,8] *)
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #AArch64_Assembly | AArch64 Assembly |
/* ARM assembly AARCH64 Raspberry PI 3B */
/* program lenAreaString64.s */
/*******************************************/
/* Constantes file */
/*******************************************/
/* for this file see task include a file in language AArch64 assembly*/
.include "../includeConstant... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #ABAP | ABAP |
report z_array_length.
data(internal_table) = value stringtab( ( `apple` ) ( `orange` ) ).
write: internal_table[ 1 ] , internal_table[ 2 ] , lines( internal_table ).
|
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Perl | Perl | #!/usr/bin/perl
use strict;
use warnings;
$_ = <<END;
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RCODE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Stata | Stata | . matrix a=2,9,4\7,5,3\6,1,8
. matrix list a
a[3,3]
c1 c2 c3
r1 2 9 4
r2 7 5 3
r3 6 1 8
. matrix b=I(3)
. matrix list b
symmetric b[3,3]
c1 c2 c3
r1 1
r2 0 1
r3 0 0 1
. matrix c=a,b
. matrix list c
c[3,6]
c1 c2 c3 c1 c2 c3
r1 2 9 4 1 0 0
r2 7 ... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Swift | Swift | let array1 = [1,2,3]
let array2 = [4,5,6]
let array3 = array1 + array2 |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Ada | Ada | with Ada.Text_IO; use Ada.Text_IO;
procedure Array_Length is
Fruits : constant array (Positive range <>) of access constant String
:= (new String'("orange"),
new String'("apple"));
begin
for Fruit of Fruits loop
Ada.Text_IO.Put (Integer'Image (Fruit'Length));
end loop;
Ada.Text_... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #ALGOL_68 | ALGOL 68 | # UPB returns the upper bound of an array, LWB the lower bound #
[]STRING fruits = ( "apple", "orange" );
print( ( ( UPB fruits - LWB fruits ) + 1, newline ) ) # prints 2 # |
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Phix | Phix | function interpret(sequence lines)
if remainder(length(lines),2)!=1 then
crash("missing header/footer?")
end if
string l1 = lines[1]
integer w = length(l1)
integer bits = (w-1)/3 -- sug: check this is 8/16/32/64
if l1!=join(repeat("+",bits+1),"--") then
crash("malformed header?"... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Tailspin | Tailspin |
def a: [1, 2, 3];
def b: [4, 5, 6];
[$a..., $b...] -> !OUT::write
|
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Tcl | Tcl | set a {1 2 3}
set b {4 5 6}
set ab [concat $a $b]; # 1 2 3 4 5 6 |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #AntLang | AntLang | array: seq["apple"; "orange"]
length[array]
/Works as a one liner: length[seq["apple"; "orange"]] |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Apex | Apex | System.debug(new String[] { 'apple', 'banana' }.size()); // Prints 2 |
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Python | Python |
"""
http://rosettacode.org/wiki/ASCII_art_diagram_converter
Python example based off Go example:
http://rosettacode.org/wiki/ASCII_art_diagram_converter#Go
"""
def validate(diagram):
# trim empty lines
rawlines = diagram.splitlines()
lines = []
for line in rawlines:
if line != '':
... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #TI-89_BASIC | TI-89 BASIC | ■ augment({1,2}, {3,4})
{1,2,3,4}
■ augment([[1][2]], [[3][4]])
[[1,3][2,4]] |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Trith | Trith | [1 2 3] [4 5 6] concat |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #APL | APL | ⍴'apple' 'orange' |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #AppleScript | AppleScript |
set theList to {"apple", "orange"}
count theList
-- or
length of theList
-- or
number of items in theList
|
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Racket | Racket | #lang racket/base
(require (only-in racket/list drop-right)
(only-in racket/string string-trim))
(provide ascii-art->struct)
;; reads ascii art from a string or input-port
;; returns:
;; list of (word-number highest-bit lowest-bit name-symbol)
;; bits per word
(define (ascii-art->struct art)
(define ... |
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Raku | Raku | grammar RFC1025 {
rule TOP { <.line-separator> [<line> <.line-separator>]+ }
rule line-separator { <.ws> '+--'+ '+' }
token line { <.ws> '|' +%% <field> }
token field { \s* <label> \s* }
token label { \w+[\s+\w+]* }
}
sub bits ($item) { ($item.chars + 1) div 3 }
sub deconstruct ($bits, %st... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #UNIX_Shell | UNIX Shell | array1=( 1 2 3 4 5 )
array2=( 6 7 8 9 10 )
botharrays=( ${array1[@]} ${array2[@]} ) |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #ARM_Assembly | ARM Assembly |
/* ARM assembly Raspberry PI */
/* program lenAreaString.s */
/* Constantes */
.equ STDOUT, 1 @ Linux output console
.equ EXIT, 1 @ Linux syscall
.equ WRITE, 4 @ Linux syscall
/* Initialized data */
.data
szMessLenArea: .ascii "The length of area is : "
sZoneconv: .fill 12,1,' '
szCarriageRe... |
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #REXX | REXX | /*REXX program interprets an ASCII art diagram for names and their bit length(s).*/
numeric digits 100 /*be able to handle large numbers. */
er= '***error*** illegal input txt' /*a literal used for error messages. */
parse arg iFID test . ... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Ursa | Ursa | # create two streams (the ursa equivalent of arrays)
# a contains the numbers 1-10, b contains 11-20
decl int<> a b
decl int i
for (set i 1) (< i 11) (inc i)
append i a
end for
for (set i 11) (< i 21) (inc i)
append i b
end for
# append the values in b to a
append b a
# output a to the console
out a... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Vala | Vala | int[] array_concat(int[]a,int[]b){
int[] c = new int[a.length + b.length];
Memory.copy(c, a, a.length * sizeof(int));
Memory.copy(&c[a.length], b, b.length * sizeof(int));
return c;
}
void main(){
int[] a = {1,2,3,4,5};
int[] b = {6,7,8};
int[] c = array_concat(a,b);
foreach(int i in c){
stdout.printf("%d\n"... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Arturo | Arturo | fruit: ["apple" "orange"]
print ["array length =" size fruit] |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #ATS | ATS |
#include
"share/atspre_staload.hats"
#include
"share/atspre_staload_libats_ML.hats"
val A0 =
array0_tuple<string>
( "apple", "orange" )
val () =
println!("length(A0) = ", length(A0))
implement main0((*void*)) = ((*void*))
|
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Ruby | Ruby | header = <<HEADER
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RCODE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QDCOUNT |
+-... |
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Rust | Rust | use std::{borrow::Cow, io::Write};
pub type Bit = bool;
#[derive(Clone, Debug)]
pub struct Field {
name: String,
from: usize,
to: usize,
}
impl Field {
pub fn new(name: String, from: usize, to: usize) -> Self {
assert!(from < to);
Self { name, from, to }
}
pub fn name(&se... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #VBA | VBA |
Option Explicit
Sub MainConcat_Array()
Dim Aray_1() As Variant, Aray_2() As Variant
Dim Result() As Variant
Aray_1 = Array(1, 2, 3, 4, 5, #11/24/2017#, "azerty")
Aray_2 = Array("A", "B", "C", 18, "End")
Result = Concat_Array(Aray_1, Aray_2)
Debug.Print "With Array 1 : " & Join(Aray_1, ", ")
De... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #VBScript | VBScript | Function ArrayConcat(arr1, arr2)
ReDim ret(UBound(arr1) + UBound(arr2) + 1)
For i = 0 To UBound(arr1)
ret(i) = arr1(i)
Next
offset = Ubound(arr1) + 1
For i = 0 To UBound(arr2)
ret(i + offset) = arr2(i)
Next
ArrayConcat = ret
End Function
arr1 = array(10,20,30)
arr2 = array(... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #AutoHotkey | AutoHotkey | MsgBox % ["apple","orange"].MaxIndex() |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #AutoIt | AutoIt | Opt('MustDeclareVars',1) ; 1 = Variables must be pre-declared.
Local $aArray[2] = ["Apple", "Orange"]
Local $Max = UBound($aArray)
ConsoleWrite("Elements in array: " & $Max & @CRLF)
For $i = 0 To $Max - 1
ConsoleWrite("aArray[" & $i & "] = '" & $aArray[$i] & "'" & @CRLF)
Next
|
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Tcl | Tcl | * using dictionaries, taking advantage of their ordering properties
* the binary command
* using (semi-)structured text as part of your source code
|
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Vlang | Vlang | import math.big
import strings
struct Result {
name string
size int
start int
end int
}
fn (r Result) str() string {
return "${r.name:-7} ${r.size:2} ${r.start:3} ${r.end:3}"
}
fn validate(diagram string) ?[]string {
mut lines := []string{}
for mut line in diagram.split("\n"... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Visual_Basic_.NET | Visual Basic .NET |
Dim iArray1() As Integer = {1, 2, 3}
Dim iArray2() As Integer = {4, 5, 6}
Dim iArray3() As Integer = Nothing
iArray3 = iArray1.Concat(iArray2).ToArray
|
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Vlang | Vlang | // V, array concatenation
// Tectonics: v run array-concatenation.v
module main
// starts here
pub fn main() {
mut arr1 := [1,2,3,4]
arr2 := [5,6,7,8]
arr1 << arr2
println(arr1)
} |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Avail | Avail | |<"Apple", "Orange">| |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #AWK | AWK | # usage: awk -f arraylen.awk
#
function countElements(array) {
for( e in array ) {c++}
return c
}
BEGIN {
array[1] = "apple"
array[2] = "orange"
print "Array length :", length(array), countElements(array)
print "String length:", array[1], length(array[1])
} |
http://rosettacode.org/wiki/ASCII_art_diagram_converter | ASCII art diagram converter | Given the RFC 1035 message diagram from Section 4.1.1 (Header section format) as a string:
http://www.ietf.org/rfc/rfc1035.txt
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z | RC... | #Wren | Wren | import "/dynamic" for Tuple
import "/fmt" for Fmt
import "/big" for BigInt
var Result = Tuple.create("Result", ["name", "size", "start", "end"])
var validate = Fn.new { |diagram|
var lines = []
for (line in diagram.split("\n")) {
line = line.trim(" \t")
if (line != "") lines.add(line)
}... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Wart | Wart | a <- '(1 2 3)
b <- '(4 5 6)
a+b
# => (1 2 3 4 5 6) |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Wren | Wren | var arr1 = [1,2,3]
var arr2 = [4,5,6]
System.print(arr1 + arr2) |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #BaCon | BaCon | ' Static arrays
DECLARE fruit$[] = { "apple", "orange" }
PRINT UBOUND(fruit$)
' Dynamic arrays
DECLARE vegetable$ ARRAY 2
vegetable$[0] = "cabbage"
vegetable$[1] = "spinach"
PRINT UBOUND(vegetable$)
' Associative arrays
DECLARE meat$ ASSOC STRING
meat$("first") = "chicken"
meat$("second") = "pork"
PRINT UBOUN... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Bash | Bash |
fruit=("apple" "orange" "lemon")
echo "${#fruit[@]}" |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Yabasic | Yabasic | sub arrayConcatenation(a(), b())
local ta, tb, nt, i
ta = arraysize(a(), 1)
tb = arraysize(b(), 1)
nt = ta + tb
redim a(nt)
for i = ta + 1 to nt
a(i) = b(i - ta)
next i
return nt
end sub
//===============================
SIZE = 5
dim a(SIZE)
dim b(SIZE)
for i = 1 to SIZE
a(i) = i
b(i) = i ... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Yacas | Yacas | Concat({1,2,3}, {4,5,6})
Out> {1, 2, 3, 4, 5, 6} |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #BASIC | BASIC | DIM X$(1 TO 2)
X$(1) = "apple"
X$(2) = "orange"
PRINT UBOUND(X$) - LBOUND(X$) + 1 |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Batch_File | Batch File |
@echo off
:_main
setlocal enabledelayedexpansion
:: This block of code is putting a list delimitered by spaces into an pseudo-array
:: In practice, this could be its own function _createArray however for the demonstration, it is built in
set colour_list=red yellow blue orange green
set array_entry=0
for %%i in (%c... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Yorick | Yorick | a = [1,2,3];
b = [4,5,6];
ab = grow(a, b); |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Z80_Assembly | Z80 Assembly | org $8000
ld hl,TestArray1 ; pointer to first array
ld de,ArrayRam ; pointer to ram area
ld bc,6 ; size of first array
ldir
; DE is already adjusted past the last entry
; of the first array
ld hl,TestArray2 ; pointer to second array
ld bc,4 ; size of second array
ldir
call Monitor_Me... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #BBC_BASIC | BBC BASIC | DIM array$(1)
array$() = "apple", "orange"
PRINT "Number of elements in array = "; DIM(array$(), 1) + 1
PRINT "Number of bytes in all elements combined = "; SUMLEN(array$())
END |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Brat | Brat |
p ["apple", "orange"].length
|
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #zkl | zkl | T(1,2).extend(T(4,5,6)) //-->L(1,2,4,5,6)
T(1,2).extend(4,5,6) //-->L(1,2,4,5,6) |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #zonnon | zonnon |
module Main;
import
System.Collections.ArrayList as Array,
System.Console as Console;
type
Vector = array {math} * of integer;
procedure Concat(x,y: Vector): Vector;
var
i,k: integer;
res: Vector;
begin
res := new Vector(len(x) + len(y));
k := 0;
for i := 0 to len(x) - 1 do
res[k] := x[i];inc(k)
end... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #BQN | BQN | ≠ 1‿"a"‿+ |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #C | C |
#include <stdio.h>
int main()
{
const char *fruit[2] = { "apples", "oranges" };
// Acquire the length of the array by dividing the size of all elements (found
// with sizeof(fruit)) by the size of the first element.
// Note that since the array elements are pointers to null-terminated charac... |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #Zsh | Zsh | a=(1 2 3)
b=(a b c)
c=($a $b) |
http://rosettacode.org/wiki/Array_concatenation | Array concatenation | Task
Show how to concatenate two arrays in your language.
If this is as simple as array1 + array2, so be it.
| #ZX_Spectrum_Basic | ZX Spectrum Basic | 10 LET x=10
20 LET y=20
30 DIM a(x)
40 DIM b(y)
50 DIM c(x+y)
60 FOR i=1 TO x
70 LET c(i)=a(i)
80 NEXT i
90 FOR i=1 TO y
100 LET c(x+i)=b(i)
110 NEXT i
120 FOR i=1 TO x+y
130 PRINT c(i);", ";
140 NEXT i
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #C.23 | C# |
using System;
class Program
{
public static void Main()
{
var fruit = new[] { "apple", "orange" };
Console.WriteLine(fruit.Length);
}
}
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #C.2B.2B | C++ | #include <array>
#include <iostream>
#include <string>
int main()
{
std::array<std::string, 2> fruit { "apples", "oranges" };
std::cout << fruit.size();
return 0;
} |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Ceylon | Ceylon | shared void run() {
value array = ["apple", "orange"];
print(array.size);
} |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Clipper.2FXBase.2B.2B | Clipper/XBase++ | /*
* nizchka: March - 2016
* This is a Clipper/XBase++ of RosettaCode Array_Length
*/
PROCEDURE MAIN()
LOCAL FRUIT := { "apples","oranges" }
? LEN(FRUIT)
RETURN
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Clojure | Clojure | ; using count:
(count ["apple" "orange"])
; OR alength if using Java arrays:
(alength (into-array ["apple" "orange"])) |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #COBOL | COBOL | identification division.
program-id. array-length.
environment division.
configuration section.
repository.
function all intrinsic.
data division.
working-storage section.
01 table-one.
05 str-field pic x(7) occurs 0 to 5 depending on t1.
... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #ColdFusion | ColdFusion |
<cfset testArray = ["apple","orange"]>
<cfoutput>Array Length = #ArrayLen(testArray)#</cfoutput>
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Common_Lisp | Common Lisp |
(print (length #("apple" "orange")))
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Component_Pascal | Component Pascal |
MODULE AryLen;
IMPORT StdLog;
TYPE
String = POINTER TO ARRAY OF CHAR;
VAR
a: ARRAY 16 OF String;
PROCEDURE NewString(s: ARRAY OF CHAR): String;
VAR
str: String;
BEGIN
NEW(str,LEN(s$) + 1);str^ := s$; RETURN str
END NewString;
PROCEDURE Length(a: ARRAY OF String): INTEGER;
VAR
i: INTEGER;
BEGIN
i := 0;
WH... |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Crystal | Crystal |
puts ["apple", "orange"].size
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #D | D |
import std.stdio;
int main()
{
auto fruit = ["apple", "orange"];
fruit.length.writeln;
return 0;
}
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Dart | Dart |
arrLength(arr) {
return arr.length;
}
main() {
var fruits = ['apple', 'orange'];
print(arrLength(fruits));
}
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #DataWeave | DataWeave | var arr = ["apple", "orange"]
sizeOf(arr)
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Delphi | Delphi |
showmessage( length(['a','b','c']).ToString );
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Dragon | Dragon | select "std"
a = ["apple","orange"]
b = length(a)
show b
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Dyalect | Dyalect | var xs = ["apple", "orange"]
print(xs.Length()) |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #EasyLang | EasyLang | fruit$[] = [ "apples" "oranges" ]
print len fruit$[] |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #EchoLisp | EchoLisp |
(length '("apple" "orange")) ;; list
→ 2
(vector-length #("apple" "orange")) ;; vector
→ 2
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Ela | Ela | length [1..10] |
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Elena | Elena |
var array := new string[]{"apple", "orange"};
var length := array.Length;
|
http://rosettacode.org/wiki/Array_length | Array length | Task
Determine the amount of elements in an array.
As an example use an array holding the strings 'apple' and 'orange'.
Other tasks related to string operations:
Metrics
Array length
String length
Copy a string
Empty string (assignment)
Counting
Word frequency
Letter frequency
Jewels and stones
I befo... | #Elixir | Elixir | iex(1)> length( ["apple", "orange"] ) # List
2
iex(2)> tuple_size( {"apple", "orange"} ) # Tuple
2 |
Subsets and Splits
Rosetta Code COBOL Python Hard Tasks
Identifies and retrieves challenging tasks that exist in both COBOL and Python, revealing cross-language programming patterns and difficulty levels for comparative analysis.
Rosetta Code Task Comparisons
Identifies tasks common to both COBOL and Python languages that are described as having difficulty levels, revealing cross-language task similarities and providing useful comparative programming examples.
Select Specific Languages Codes
Retrieves specific programming language names and codes from training data, providing basic filtering but limited analytical value beyond identifying these particular languages.