MATLAB: Find and replace in a character array

arrayarrayscell arrays

Hey, I have this character array F='(B~C) + (~AB)'. How can I assess the array to locate all the terms that has a ~ before it and replace it with a ('). So ~C should be C'. Therefore I would like F to be F=(BC') + (A'B)

Best Answer

F='(B~C) + (~AB)'
F = regexprep(F, '~(.)', '$1''')