Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dop251/goja
/ String
Method
String
unistring/string.go:102–108 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
100
}
101
102
func
(s String) String() string {
103
if
b := s.AsUtf16(); b != nil {
104
return
string(utf16.Decode(b[1:]))
105
}
106
107
return
string(s)
108
}
109
110
func
(s String) AsUtf16() []uint16 {
111
if
len(s) < 4 || len(s)&1 != 0 {
Callers
1
BenchmarkToUTF8String
Function · 0.95
Implementers
1
importedString
string_imported.go
Calls
1
AsUtf16
Method · 0.95
Tested by
1
BenchmarkToUTF8String
Function · 0.76