Skip to content

Commit

Permalink
Update string.ahk
Browse files Browse the repository at this point in the history
substr changed a bit.
  • Loading branch information
ewerybody committed May 3, 2024
1 parent e8395d7 commit 4d6fbc1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/Autohotkey/lib/string.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ string_is_in_array(search, string_list, start := 1) {
string_is_web_address(string) {
if ( RegExMatch(string, "i)^http://") OR RegExMatch(string, "i)^https://") )
return true
else {
WEB_TLDS := ["html", "com", "de", "net", "org", "co.uk"]
Loop(WEB_TLDS.Length) {
ext := WEB_TLDS[A_Index]
sub := SubStr(string, - StrLen(ext))
if (sub == "." ext)
return true
}

WEB_TLDS := ["html", "com", "de", "net", "org", "co.uk"]
Loop(WEB_TLDS.Length) {
ext := "." . WEB_TLDS[A_Index]
sub := SubStr(string, - StrLen(ext))
if (sub == ext)
return true
}
return false
}

; Determine if a string starts with another string.
Expand Down

0 comments on commit 4d6fbc1

Please sign in to comment.