0

I'm accepting input from user while copy pasting text from Microsoft Word single quote is coming as right single quote.

that is

Original Text:  speaker’s
Expected Text : speaker's

is there any way or libraries to convert characters similar to these

THess
  • 1,003
  • 1
  • 13
  • 21
user3878073
  • 81
  • 1
  • 1
  • 7
  • I don't think there is a library. You want to convert unicode to a subset and adjust characters that are missing in the subset. You can use the replace-methods of string. – Ralf Renz Nov 26 '19 at 09:47
  • `s = s.replaceAll("[‘’‚‛‹›′‵]", "\'").replaceAll("[“”„‟″‴‶‷»«]", "\"";` (use UTF-8) – Joop Eggen Nov 26 '19 at 10:00

1 Answers1

1

You could try something like:

"speaker’s".replaceAll("’", "'")
Idriss Neumann
  • 3,760
  • 2
  • 23
  • 32