Only the spaces in STRING. However, if I inadvertently delete the space between STRING and NN, I can add it back in.
Dennis Fisher MD P < (The "P Less Than" Company) Phone / Fax: 1-866-PLessThan (1-866-753-7784) www.PLessThan.com <http://www.plessthan.com/> > On Jul 28, 2020, at 1:29 PM, cpolw...@chemo.org.uk wrote: > > On 2020-07-28 21:20, Dennis Fisher wrote: >> R 4.0.2 >> OS X >> Colleagues >> I have strings that contain a space in an unexpected location. The >> intended string is: >> “STRING 01. Remainder of the string" >> However, variants are: >> “STR ING 01. Remainder of the string" >> “STRIN G 01. Remainder of the string" >> I would like a general approach to deleting a space, but only if it >> appears before the period. Any suggestions on a regular expression >> for this? > > You aren't deleting the space before 0? Is that in the requirement? [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.