Blender Git Commit Log

Git Commits -> Revision 7e91a60

Revision 7e91a60 by Sybren A. Stüvel (master)
July 27, 2021, 17:49 (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: 7e91a60be6d1ced76d0aeef2665c9792af282e0e
Parent Commit: c6ba735
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)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021