# ee.String.trim

Returns a string whose value is the original string, with any leading and trailing whitespace removed.

<br />

| Usage | Returns |
|---|---|
| `String.trim()` | String |

| Argument | Type | Details |
|---|---|---|
| this: `string` | String | The string to trim. |

## Examples

### Code Editor (JavaScript)

```javascript
var s = ee.String('\t\n\r abc\t\n\r ');
print(s.trim());  // "abc"

var s = ee.String(' a\t\n\r b ');
print(s.trim());  // "a\t\n\r b"
```
Python setup

See the [Python Environment](https://developers.google.com/earth-engine/guides/python_install) page for information on the Python API and using
`geemap` for interactive development.

```python
import ee
import geemap.core as geemap
```

### Colab (Python)

```python
s = ee.String('\t\n\r abc\t\n\r ')
display(s.trim())  # "abc"

s = ee.String(' a\t\n\r b ')
display(s.trim())  # "a\t\n\r b"
```