50 lines
1.1 KiB
Go
50 lines
1.1 KiB
Go
// Code generated by zi2go from std_text.zi. DO NOT EDIT.
|
|
package main
|
|
|
|
func StdText_LowerASCII(value uint8) uint8 {
|
|
if value >= 65 && value <= 90 {
|
|
return value + 32
|
|
}
|
|
return value
|
|
}
|
|
|
|
func StdText_StartsWithFoldASCII(value string, prefix string) bool {
|
|
if int32(int64(len(prefix))) > int32(int64(len(value))) {
|
|
return false
|
|
}
|
|
var index int32 = 0
|
|
for index < int32(int64(len(prefix))) {
|
|
if StdText_LowerASCII(value[index]) != StdText_LowerASCII(prefix[index]) {
|
|
return false
|
|
}
|
|
index = index + 1
|
|
}
|
|
return true
|
|
}
|
|
|
|
func StdText_ContainsFoldASCII(value string, needle string) bool {
|
|
if int32(int64(len(needle))) == 0 {
|
|
return true
|
|
}
|
|
if int32(int64(len(needle))) > int32(int64(len(value))) {
|
|
return false
|
|
}
|
|
var start int32 = 0
|
|
for start <= int32(int64(len(value)))-int32(int64(len(needle))) {
|
|
var index int32 = 0
|
|
same := true
|
|
for index < int32(int64(len(needle))) {
|
|
if StdText_LowerASCII(value[(start+index)]) != StdText_LowerASCII(needle[index]) {
|
|
same = false
|
|
break
|
|
}
|
|
index = index + 1
|
|
}
|
|
if same {
|
|
return true
|
|
}
|
|
start = start + 1
|
|
}
|
|
return false
|
|
}
|