How To Remove Graves Accent From String

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
roonyrooxcess
Posts: 61
Joined: 20 Nov 2020, 21:29

How To Remove Graves Accent From String

25 Nov 2021, 08:28

Hi, Ive tried to remove graves accent from string

StringReplace, Contents, Contents,',, All

but its clearly not working ... whats the correct syntax ...

Thanks!
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: How To Remove Graves Accent From String

25 Nov 2021, 09:03

I had no difficulty but do not recommend using deprecated commands.

Code: Select all

text = a'b'c'd
StringReplace, text, text, ',, All
SendInput {Text}%text%
Explained: StringReplace
User avatar
boiler
Posts: 17390
Joined: 21 Dec 2014, 02:44

Re: How To Remove Graves Accent From String

25 Nov 2021, 09:15

If you mean you want to remove the accents from accented characters, then you have to replace the characters themselves. One approach:

Code: Select all

MsgBox, % RemoveGrave("Remove the acccents from these letters: ÀàÈèÌìÒòÙù")
return

RemoveGrave(str) {
	static chars := {"À":"A","à":"a","È":"E","è":"e","Ì":"I","ì":"i","Ò":"O","ò":"o","Ù":"U","ù":"u"}
	for a, u in chars
		str := StrReplace(str, a, u)
	return str
}
gregster
Posts: 9111
Joined: 30 Sep 2013, 06:48

Re: How To Remove Graves Accent From String

26 Nov 2021, 00:52

This function by lexikos could help, if you want to remove diacritics: viewtopic.php?f=6&t=8089#p47548

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 166 guests