Blender Git Loki

Git Commits -> Revision b1602da

July 30, 2021, 14:56 (GMT)
Add `StringRef::trim()` functions

Add three functions that trim characters from the front & end of a
`StringRef`. All functions return a new `StringRef` that references a
sub-string of the original `StringRef`.

- `trim(chars_to_remove)`: strips all characters from the start and end
that occur in `chars_to_remove`.
- `trim(char_to_remove)`: same, but with a single character to remove.
- `trim()`: remove leading & trailing whitespace, so same as
`trim(" rnt")`

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12031

Commit Details:

Full Hash: b1602da72fe347dca2d298280bb5581fe3eaf6c3
Parent Commit: 8105cc6
Committed By: Fabian Schempp
Lines Changed: +80, -0

2 Modified Paths:

/source/blender/blenlib/BLI_string_ref.hh (+42, -0) (Diff)
/source/blender/blenlib/tests/BLI_string_ref_test.cc (+38, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021