how to replace a middot "·" Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Maxsteinfeld
Posts: 87
Joined: 25 Jun 2017, 02:18

how to replace a middot "·"

Post by Maxsteinfeld » 29 Aug 2017, 12:45

Hi
how can i replace a middot "·" (ISO-8859-1: hex B6, dez 183) in a string (e.g. line1) with a comma "," ?

StringReplace, line1, line1,  ·,% ",", All
does not match

regards
Max

Nightwolf85
Posts: 302
Joined: 05 Feb 2017, 00:03

Re: how to replace a middot "·"

Post by Nightwolf85 » 29 Aug 2017, 13:25

This appears to work for me:

Code: Select all

line1 := StrReplace(line1, "·", ",")
Edit: So does your initial code actually. So not sure my version is any better.

Maxsteinfeld
Posts: 87
Joined: 25 Jun 2017, 02:18

Re: how to replace a middot "·"  Topic is solved

Post by Maxsteinfeld » 29 Aug 2017, 13:47

Nightwolf85 wrote:This appears to work for me:

Code: Select all

line1 := StrReplace(line1, "·", ",")
Edit: So does your initial code actually. So not sure my version is any better.
Thx
That code works :)
Best regards

User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: how to replace a middot "·"

Post by jeeswg » 29 Aug 2017, 13:54

@Maxsteinfeld: Your original code works for me, although I would recommend to use StrReplace, as StringReplace won't be available in AHK v2.

Code: Select all

q::
line1 := "a·a"
line1 := StrReplace(line1, Chr(183), ",")
MsgBox, % line1

line1 := "a·a"
StringReplace, line1, line1,  ·,% ",", All
MsgBox, % line1
return
One possibility is that the character looks like Chr(183) but isn't, so I would check the char number for each character, see 'LIST ALL CHARACTERS THAT APPEAR IN A STRING' here for an example:
jeeswg's characters tutorial - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=26486

Btw I was wondering about hex and 'dez', although it looks like 'dez' may be German for 'dec'.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Maxsteinfeld
Posts: 87
Joined: 25 Jun 2017, 02:18

Re: how to replace a middot "·"

Post by Maxsteinfeld » 29 Aug 2017, 15:56

Hi Jeeswg,
you are right - no idea why the line:
StringReplace, line1, line1, ·,% ",", All
had not worked for me - it works now :)
(perhaps i do not reload the script)
and many thanks for the links
regards
Max (German)

Post Reply

Return to “Ask for Help (v1)”