In the previous recipe, we defined a new component and used it in our application. However, in some cases, the choice may not be to define a new component. Rather, we may have to see if we can add the capability to the existing component. For example,
formatWithWordBreak, in such a way that, once it is added, it is available to the complete application code to make use of this new method without defining a
MyString class and using it wherever we need the
formatWithWordBreak method. This recipe will take us through the steps to achieve this requirement.
Make sure you have set up your development environment by ...