Question: Use Swift Code Write own string class. The class will store a private string as its only instance data and implement CustomStringConvertible in a way

Use Swift Code

Write own string class. The class will store a private string as its only instance data and implement CustomStringConvertible in a way that returns the stored string.

Within the class, add support for the following operators (none of these should modify the parameter objects, they should return a new object instead):

+ //concatenates two strings and returns the new one

- //removes any occurrences of the second string from the first

/ //splits the first string on occurrences of the second string (return an array of the split strings)

* //interleaves the two strings

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!