2 Data Structures and Algorithms R emar k s Each programming language contains a character set that is used to communicate with the computer. This set usually includes the followings- Alphabet- A B C D… X Y Z Digits- 1 2.. 9 Special Characters- + - / * . (), {}, , $ etc..
3 Data Structures and Algorithms Storing String For Example,
4 Data Structures and Algorithms Storing String 1. Fixed- length storage.
5 Data Structures and Algorithms Storing String 1. Fixed- length storage.
6 Data Structures and Algorithms Storing String 2. Variable- length storage with fixed maximum.
7 Data Structures and Algorithms Storing String 2. Variable- length storage with fixed maximum.
8 Data Structures and Algorithms Storing String 3. Linked storage
9 Data Structures and Algorithms String Operation Length: LENGTH (string) e.g.- LENGTH(‘Mark Zuckerberg’)= 15 Substring: SUBSTRING(string, initial, length) e.g.- SUBSTRING(‘Impossible is a word found in coward’s dictionary’,0,20) = Impossible is a word Indexing: INDEX(string, pattern) e.g.- INDEX(‘He is wearing glasses’, ‘ear’)= 8 Concatenation: String1//String2 e.g.- ‘To be or not to be’// ‘, this is the question.’= To be or not to be, this is the question