Files
playlet-piped/playlet-lib/src/source/utils/StringUtils.bs
T
Brahim Hadriche 9c76a468aa Feature/drm support (#766)
* Drm support

* A few tweaks to http connection

* changelog

* changelog

* add requires_widevine_drm to app manifest

* movie renderer nodes

* Small fix in header parsing
2025-10-26 12:35:49 -04:00

34 lines
1.0 KiB
Plaintext

namespace StringUtils
function IsNullOrEmpty(obj as dynamic) as boolean
return ((obj = invalid) or (GetInterface(obj, "ifString") = invalid) or (Len(obj) = 0))
end function
function PathJoin(path1 as string, path2 as string) as string
if path1.EndsWith("/")
path1 = path1.left(path1.len() - 1)
end if
if path2.StartsWith("/")
path2 = path2.Mid(1)
end if
return path1 + "/" + path2
end function
function GetBetween(input as string, startStr as string, endStr as string) as string
startIndex = input.InStr(startStr)
if startIndex = -1
return ""
end if
startIndex = startIndex + startStr.len()
endIndex = input.InStr(startIndex, endStr)
if endIndex = -1
return ""
end if
return input.Mid(startIndex, endIndex - startIndex)
end function
function RandomId() as string
return StrI(rnd(2147483647), 36)
end function
end namespace