-5

"The string? is made up a load of strings but the problem is the removal of question mark in the word string? without removing the other question marks. can anybody have a look?"

In the above text I have to alter "string?" to "string". But I dont want the statement to lose the rest of the ? in the text.

Resultant text should be: "The string is made up a load of strings but the problem is the removal of question mark in the word string without removing the other question marks. can anybody have a look?"

I have tried gsub, string_replace and a number of other methods, they end up removing or replacing the word and still keeping the "?"

TBhavnani
  • 721
  • 7
  • 12
  • 1
    can you mention your try also ? i mean in code – Vikas Periyadath Feb 07 '18 at 07:37
  • What of the second question mark – Onyambu Feb 07 '18 at 07:38
  • 1
    "Is this an april-fools joke?" ... Its Feb! "You go" python tutorials... burden Tarun with knowledgeable background info. Second of all.... either solution in python or R... be specific. – ZF007 Feb 07 '18 at 07:42
  • 1
    You tell him @ZF007! Asking solutions in either R/python is not the problem, SO questions deserve more effort than this! Tarun - as Vikas has stated, please post the code you have tried. Also, please lookup [How to ask a question on SO](https://stackoverflow.com/help/how-to-ask) – Vivek Kalyanarangan Feb 07 '18 at 07:52
  • 2
    *"I have tried......"*, where is this attempt in your question? – RoadRunner Feb 07 '18 at 07:53
  • @VivekKalyanarangan... killing the MCVE suspense... [here](https://stackoverflow.com/help/mcve) it is for Tarun. – ZF007 Feb 07 '18 at 07:55
  • All the guys who have given a minus one to the question,please be kind enough to solve the problem as well. I'll repeat the question: We need to replace the word "string?" with "string" and also the question mark at the end must not get removed. TY! – TBhavnani Feb 08 '18 at 12:22

1 Answers1

1
string.replace('string?', 'string')

Gives:

'The string is made up a load of strings but the problem is the removal of 
question mark in the word string without removing the other question marks. 
can anybody have a look?'
mij
  • 532
  • 6
  • 13