MCPcopy Create free account
hub / github.com/aiscriptdev/aiscript / trim_end

Function trim_end

aiscript-vm/src/builtins/string.rs:98–107  ·  view source on GitHub ↗
(
    mc: &'gc Mutation<'gc>,
    receiver: Value<'gc>,
    _args: Vec<Value<'gc>>,
)

Source from the content-addressed store, hash-verified

96}
97
98fn trim_end<'gc>(
99 mc: &'gc Mutation<'gc>,
100 receiver: Value<'gc>,
101 _args: Vec<Value<'gc>>,
102) -> Result<Value<'gc>, VmError> {
103 let s = receiver.as_string_value()?;
104 let trimmed = s.as_str().trim_end();
105 // Ok(Value::String(mc.intern(trimmed.as_bytes())))
106 Ok(Value::IoString(Gc::new(mc, trimmed.to_owned())))
107}
108
109// Contains and position functions
110fn contains<'gc>(

Callers

nothing calls this directly

Calls 2

as_string_valueMethod · 0.80
as_strMethod · 0.45

Tested by

no test coverage detected