My task: Trimming extra spaces to one space around apostrophe.
case 1: Jones'car. expected result: Jones' car
case 2: Jones 'car expected result: Jones' car
case 3: Sam' s car expected result: Sam's car
case 4: Sam 's car expected result: Sam's car
other cases like Sam ' s car or Jones ' car which should ideally return in Sam's car or Jones' car
I am experimenting with the code below by adjusting the spaces within the "" "" ; what if more than 1 space occur around apostrophe?
Is the below approach the right one to crack this problem?
sub Apostrophe()
ActiveDocument.Range.Text = Replace(ActiveDocument.Range.Text, "" & ChrW(&H2019) & "", "" & ChrW(&H2019) & " ")
end sub