Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7567799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:45:30+00:00 2026-05-30T14:45:30+00:00

I would like to strip ‘s (apostrophe s) from a string. For example: a=it’s

  • 0

I would like to strip ‘s (apostrophe s) from a string.

For example:

a="it's tail was big".split()
for i in range(len(a)):
    a[i]= a[i].strip(r"\'s")

a becomes

['it', 'tail', 'wa', 'big']

whereas I am expecting

['it', 'tail', 'was', 'big']

How do I make it strip ‘s and not s ? I tried strip(r”\’s”) too & it doesn’t work either.

And

Is there a better way to do this than what I have done?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T14:45:31+00:00Added an answer on May 30, 2026 at 2:45 pm

    You can replace the 's with empty string and then split.

    >>> txt ="it's tail was big"
    >>> txt.replace("'s", '').split()
    ['it', 'tail', 'was', 'big']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to strip out non-numeric elements from the POST data before using
I would like to strip everything in a string before a - and leave
I would like to filter a string and strip all characters that are not
I would like access to the page name from within a page. For example
I would like to strip a string to have only numeric values and one
I would like to strip all img tags from a certain text, except for
Given a string, I would like to strip it, but I want to have
I would like to strip the leading slash and the querystring from a URL
I would like a brief and easy way to strip tags from an XHTML
I would like to grab the prices of products from newegg. heres an example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.