why you use
Code: Select all
RTrim(s, this)
Code: Select all
SubStr(s, 1, -StrLen(this))
Code: Select all
RTrim(s, this)
Code: Select all
SubStr(s, 1, -StrLen(this))
like concat in string libraryDescolada wrote: ↑18 Mar 2023, 11:07@aliztori, I'm not sure where you got the line RTrim(s, this) since I can't find it in any of the libs, but I will assume you are talking about InsertLine. This is because I pretty much 1-on-1 converted it from String Things library by tidbits, and didn't look too deep into it.
SubStr(new, 1, -StrLen(delim)) can't be used, because Loop Parse only allows single-character delimiters. This means that SubStr(new, 1, -(line > count ? 2 : 1)) should work and I'll update the library accordingly.
Code: Select all
static Concat(words*) {
delim := this, s := ""
for v in words
s .= v . delim
return SubStr(s,1,-StrLen(this))
}
like concat in string libraryDescolada wrote: ↑18 Mar 2023, 11:07@aliztori, I'm not sure where you got the line RTrim(s, this) since I can't find it in any of the libs, but I will assume you are talking about InsertLine. This is because I pretty much 1-on-1 converted it from String Things library by tidbits, and didn't look too deep into it.
SubStr(new, 1, -StrLen(delim)) can't be used, because Loop Parse only allows single-character delimiters. This means that SubStr(new, 1, -(line > count ? 2 : 1)) should work and I'll update the library accordingly.
Code: Select all
static Concat(words*) {
delim := this, s := ""
for v in words
s .= v . delim
return SubStr(s,1,-StrLen(this)) ;it would be Rtrim(s, this)
}
Yeah your right, good point
Code: Select all
#include ..\Lib\Misc.ahk
#include ..\Lib\Array.ahk
thnksDescolada wrote: ↑22 Mar 2023, 00:00@aliztori, if you are referring to the double periods, then you can read about those from Microsofts' path naming rules.
Code: Select all
static Format(args*) => Format(this, args*)
Code: Select all
job := "Programmer"
age := 20
"ali is {1} and his age is {2}".Format(job, age)
Code: Select all
__ObjDefineProp := Object.Prototype.DefineProp
__ObjDefineProp(Primitive.Prototype, "__Call", {
Call:(this, name, params) => %name%(this, params*)
})
job := "Programmer"
age := 20
"ali is {1} and his age is {2}".Format(job, age).MsgBox()
Code: Select all
static Rand() {
Arr := this
randIndex := Random(1, Arr.Length)
return Arr[randIndex]
}