Skip to content

Move and rename the tokenise() function for splitting strings to core/foundation #8807

@guitargeek

Description

@guitargeek

In different ROOT components, it is convenient to have a helper function that takes a string, similar to the str.split function that Python has for example:

"a,b,c,d,e".split(",") # returns ['a', 'b', 'c', 'd', 'e']

Currently, there is code duplication to provide such a function in separate ROOT components like roofit and hist:

As suggested by @Axel-Naumann in #8801 (comment), this general function should be moved into foundation/core to about the code duplication and make the string-splitting functionality available the every ROOT component.

It is still an open question what the name of the function should be (as well as the name of the file it's in), and whether it should return a std::vector<std::string> or std::vector<std::string_view>.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions