0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 04:12:23 +01:00
posthog/hogvm/__tests__/strings.hog
Marius Andra 70c6ce8885
feat(hog): fix elements matching (#24331)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-05 12:07:12 +02:00

27 lines
1008 B
Plaintext

print(trim(' hello world '))
print(trimLeft(' hello world '))
print(trimRight(' hello world '))
print(trim('xxxx hello world xx', 'x'))
print(trimLeft('xxxx hello world xx', 'x'))
print(trimRight('xxxx hello world xx', 'x'))
print(splitByString(' ', 'hello world and more'))
print(splitByString(' ', 'hello world and more', 1))
print(splitByString(' ', 'hello world and more', 2))
print(splitByString(' ', 'hello world and more', 10))
print(like('banana', 'N'))
print(like('banana', 'n'))
print(like('banana', 'naan'))
print(ilike('banana', 'N'))
print(ilike('banana', 'n'))
print(ilike('banana', 'naan'))
print(notLike('banana', 'N'))
print(notILike('banana', 'NO'))
print(position('abc', 'a')) // 1
print(position('abc', 'b')) // 2
print(position('abc', 'c')) // 3
print(position('abc', 'd')) // 0
print(positionCaseInsensitive('AbC', 'a')) // 1
print(positionCaseInsensitive('AbC', 'b')) // 2
print(positionCaseInsensitive('AbC', 'c')) // 3
print(positionCaseInsensitive('AbC', 'd')) // 0