---
name: "Catmandu::Fix::trim"
section: "3pm"
platform: "linux"
package: "libcatmandu-perl"
version: "1.2024-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Catmandu::Fix::trim"
---

# Catmandu::Fix::trim(3pm)

trim leading and ending junk from the value of a field

## NAME

Catmandu::Fix::trim - trim leading and ending junk from the value of a field

## SYNOPSIS

```
   # the default mode trims whitespace
   # e.g. foo => '   abc   ';
   trim(foo) # foo => 'abc';
   trim(foo, whitespace) # foo => 'abc';

   # trim non-word characters
   # e.g. foo => '   abc  / : .';
   trim(foo, nonword) # foo => 'abc';
   # trim accents
   # e.g. foo => 'français' ;
   trim(foo,diacritics) # foo => 'francais'
```

## SEE ALSO

Catmandu::Fix
