str.trim
Removes whitespace from around a string and hands back the result. Which characters count as whitespace is not stated in this edition.
str.trim(const string source) → const stringstr.trim(input string source) → input stringstr.trim(series string source) → series stringstr.trim(simple string source) → simple string| Parameter | Type | Required | Description |
|---|---|---|---|
source | const string | yes | the string to trim |
Returns const string or input string or series string or simple string — A string in the form of the argument you pass.
indicator("Trimmed text")
alert(str.trim(" breakout "))
plot(close)See also str.contains · str.endswith · str.format_time
Part of the function index.
Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.