Skip to main content

trim_javascript

Function trim_javascript 

Source
pub fn trim_javascript(text: &str) -> &str
Expand description

What: Remove leading and trailing JavaScript whitespace, as String.prototype.trim. &str borrows text; the result borrows a slice of it. Why: Shared strings must be trimmed exactly as the incumbent trims them.

In TS you’d write (pseudocode):

function trimJavascript(text: string): string { return text.trim(); }