0
点赞
收藏
分享

微信扫一扫

[FUNC]为字符串类添点料

千白莫 2023-04-25 阅读 45


为字符串类添点料,抛砖引玉,enjoy!

"".base.base := Strings

MsgBox, % "hello".len()
MsgBox, % "hello".add(" world")
str:="你好"
MsgBox % str.add("阿宽!")
MsgBox % str.equals("您好")

Class Strings {
	len()
	{
		return StrLen(this)
	}
	add(str)
	{
		return this . str
	}
	equals(str)
	{
		if (!this || !str)
			return !this && !str
		return str = this
	}
}




举报

相关推荐

0 条评论