Counts the original text and builds the result: it removes line breaks, spaces, and invisible characters, or changes the case.