Creating an Array: Difference between revisions

Content added Content deleted
m (→‎[[Perl]]: Added link to interpreter. Removed "none needed" library reference.)
No edit summary
Line 238: Line 238:


string[,] funny_matrix = new string[2][2]{ {"clowns", "are"} , {"not", "funny"} };
string[,] funny_matrix = new string[2][2]{ {"clowns", "are"} , {"not", "funny"} };

==[[Smalltalk]]==

array := Array withAll: #('an' 'apple' 'a' 'day' 'keeps' 'the' 'doctor' 'away').

"Access the first element of the array"
elem := array at: 1.

"Replace apple with orange"
array at: 2 put: 'orange'.