April 2018
Intermediate to advanced
222 pages
5h 28m
English
Strings are dynamic data types that are based on bytes arrays discussed in the previous section. They are very similar to bytes with additional constraints. Strings cannot be indexed or pushed and do not have the length property. To perform any of these actions on string variables, they should first be converted into bytes and then converted back to strings after the operation.
Strings can be composed of characters within single or double quotes.
Strings can be declared and assigned values directly, as follows:
String name = 'Ritesh Modi" ;
They can be also converted to bytes, as follows:
Bytes byteName = bytes(name) ;