This function returns the part of the string as an output.