c# - Find and replace all the words starting with a specific character -


i have requirement replace words starting $ in word document

sample:

$address $lastname etc. 

now @ beginning must create list words start $ after replace words

$lastname -> waning etc 

how can create list words starting $ in spiredoc ?

you can use regular expression , fillallpattern() method find words start $ , return results in textselection collection.

regex regex = new regex(@"\$\w+\b"); textselection[] selections = document.findallpattern(regex); 

to replace string matches specific regex new string, use document.replace(system.text.regularexpressions.regex pattern, string replace) method.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -