title: Add character after a condition
body: <pre><code>stringg &lt;- c(&quot;You are\ngoing to learn 3 things, the first one is not to extract, and\n2 and 3 are simply digits.&quot;, &quot;....&quot;, &quot;....&quot;,....)
  </code></pre>
  <p>in R Studio I want to find all listitem/strings which ends with a &quot;.&quot; and after the dot I want to add a $ sign to it.</p>
  <pre><code>grep(&quot;\\.$&quot;, stringg , value = TRUE) # this gives me the string from list which ends with a dot
  </code></pre>
  <p>with which command can I add the $?</p>
  <p>I know I could use str_replace like following but I want to know if I could add instead of replacing it?</p>
  <pre><code>str_replace(stringg, &quot;\\.$&quot;, &quot;.$&quot;)
  </code></pre>
  <p>thanks!</p>