Answers.Body: <p>As it happens, this solved my issue: <code>{{ personfirstandlastname|replace({'\'':''}) }}</code></p>
  
  <p><strong>EDIT</strong></p>
  
  <p>To clarify, this isn't a valid Twig object:</p>
  
  <pre><code>{'\'',''}
  </code></pre>
  
  <p>... while this is:</p>
  
  <pre><code>{'\'':''}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-07T23:57:37.833Z
Answers.Text: Wasn't that what you described specifically _not_ working in your question? _edit: nevermind, I see the `,` became a `:`_
Answers.UserDisplayName: Matt Stein
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-08T12:52:13.270Z
Answers.Text: @MattStein i will be increasing text sizes in my browser.
Answers.UserDisplayName: isral
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-07T23:43:58.353Z
Answers.LastActivityDate: 2017-06-08T00:05:00.330Z
Answers.LastEditDate: 2017-06-08T00:05:00.330Z
Answers.UserDisplayName: isral
Body: <p>My client needs to input apostrophes in text fields for staff names, such as &rsquo; or just the plain ' and as you can imagine, it is causing issues.</p>
  
  <p>I have tried this <code>replace({'\'',''})</code> and this <code>replace({'\&amp;rsquo;',''})</code> but to no success. Thoughts?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-06T22:46:33.427Z
Comments.Text: Can you be more specific describing the problem, isral? Plain Text fields should handle straight or curly apostrophes just fine without any special handling, and I believe Rich Text fields should be no different. I'm struggling to understand why the client inputting them is a problem _and_ why you're attempting to remove them at the template level.
Comments.UserDisplayName: Matt Stein
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-07T23:40:59.617Z
Comments.Text: Hi, @MattStein. i am removing them at the template level because i use thise text fields to create IDs which are targeted in JS/jQ. For example, if the field has "First L'ast" then JS won't be able to get the IDs because they become something like `data-target="firstl'ast"`.
Comments.UserDisplayName: isral
Tags: <templating><replace><escaping>
Title: Remove Quotes from Text Fields
ThreadText: # Remove Quotes from Text Fields
  
  (Asked by: username_0 on 2017-06-06)
  
  My client needs to input apostrophes in text fields for staff names, such as ’ or just the plain ' and as you can imagine, it is causing issues.
  
  I have tried this `replace({'\'',''})` and this `replace({'\&rsquo;',''})` but to no success. Thoughts?
  
  **Tags:** templating, replace, escaping
  
  > **Comments:**
  > **username_1**: Can you be more specific describing the problem, username_0? Plain Text fields should handle straight or curly apostrophes just fine without any special handling, and I believe Rich Text fields should be no different. I'm struggling to understand why the client inputting them is a problem _and_ why you're attempting to remove them at the template level.  
  > **username_0**: Hi, @username_1. i am removing them at the template level because i use thise text fields to create IDs which are targeted in JS/jQ. For example, if the field has "First L'ast" then JS won't be able to get the IDs because they become something like `data-target="firstl'ast"`.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-06-07. Score: 1 | Accepted answer
  
  As it happens, this solved my issue: `{{ personfirstandlastname|replace({'\'':''}) }}`
  
  **EDIT**
  
  To clarify, this isn't a valid Twig object:
  
  ```
  {'\'',''}
  
  ```
  
  ... while this is:
  
  ```
  {'\'':''}
  
  ```
  
  > **Comments:**
  > **username_1**: Wasn't that what you described specifically _not_ working in your question? _edit: nevermind, I see the `,` became a `:`_  
  > **username_0**: @username_1 i will be increasing text sizes in my browser.  
  
  ---
  
  