---
name: "ne_shave"
section: "3"
platform: "linux"
package: "neon"
version: "0.37.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ne_shave"
---

# ne\_shave(3)

trim whitespace from a string

## NAME

ne\_shave - trim whitespace from a string

## SYNOPSIS

```
#include <ne_string.h>
```

**char \*ne\_shave(char \****str***, const char \****whitespace***);**

## DESCRIPTION

**ne\_shave** returns a portion of *str* with any leading or trailing characters in the *whitespace* array removed. *str* may be modified. Note that the return value may not be equal to *str*.

## EXAMPLES

The following code segment will output "fish":

```
char s[] = ".!.fish!.!";
puts(ne_shave(s, ".!"));
```

## COPYRIGHT

Copyright © 2001-2026 Joe Orton\
