String Implement a custom type for representing strings in C++. Allow following operations as well as operators, considering dynamic memory allocation: Operations: • length: determine the length of...


String<br>Implement a custom type for representing strings in C++. Allow following operations as well as<br>operators, considering dynamic memory allocation:<br>Operations:<br>• length: determine the length of string<br>upper: convert the string to upper case<br>• lower: convert the string to lower case<br>• at: return character at a given index<br>• substring: extract a substring given start and end<br>• index: find starting index of a substring<br>• compare: compare two strings<br>concat: concatenate/append the argument after current string. Cater cases for different data<br>types such as String, C-string, char, int, float<br>prepend: concatenate/append the argument before current string. Cater cases for different data<br>types such as String, char, int, float<br>Operators:<br>+ : for concatenation and prepend operations taking into account different data types and order<br>of argumets<br>= : for assignment<br>• =, !=, < and > : for comparison operations<br>] : for access to character at a given index<br>>> and << : for output and input a string<br>

Extracted text: String Implement a custom type for representing strings in C++. Allow following operations as well as operators, considering dynamic memory allocation: Operations: • length: determine the length of string upper: convert the string to upper case • lower: convert the string to lower case • at: return character at a given index • substring: extract a substring given start and end • index: find starting index of a substring • compare: compare two strings concat: concatenate/append the argument after current string. Cater cases for different data types such as String, C-string, char, int, float prepend: concatenate/append the argument before current string. Cater cases for different data types such as String, char, int, float Operators: + : for concatenation and prepend operations taking into account different data types and order of argumets = : for assignment • =, !=, < and=""> : for comparison operations ] : for access to character at a given index >> and < :="" for="" output="" and="" input="" a="">

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here