Chapter 4 - Strings and Associative Arrays Flashcards
Strings are arrays of characters?
More accurately, you can READ individual chracters the same way you read specific values in a numerical array, and these individual values are strings of length
Are strings mutable?
No they are immutable: they can be completely replaced in their entirety, but not changed piecewise.
How would I be able to manipulate string characters?
You must :
1) Split the string into an array
2) Make individual changes within that array
3) Then join the array to reform a string
Referencing individual elements using»>
Convert string to array using»_space;>
Convert array back to string usng»>
String.length, string.split, array.join
Describe string.split
Converts string to array, splitting on the provided parameter.
Describe what array.join does
By default it will convert an array to a string. Using a provided parameter as a separator…by default it will use ‘,’