Trimming method for mutable attributed strings.