gchq / gchq/CyberChef

Operation request: Trim start/end matching a character

Open
#1,683 2 comments 1 reaction 0 assignees View on GitHub
operation
Dominant language
JavaScript
Stars
35.8k
Forks
4.1k
Avg merge
2d 26m
Merged PRs (30d)
33

Description

## Summary
Often I need to trim the start or end of a string, eg. to strip leading/trailing quotes or newlines. This doesn't seem to be an operation yet.

This can currently be roughly emulated with `Drop_bytes(0,1,false)Drop_bytes(-1,1,false)`, but this isn't as flexible.

### Example Input
`aaabbbccc`

### Example Output
When trimming text `a`: `bbbccc`
When trimming text `c`: `aaabbb`
When trimming regex `[a|c]{2}`: `abbbc`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.