The four methods below are now obsolescent but for now will work. They are being replaced by same-name methods in G4FieldManager, allowing the specialisation in different volumes.
Will be removed in future releases for std::string compliance If passing G4String to functions requiring const char*, use std::string::c_str to explicitly convert. G4String also implicitly converts to std::string_view to match the std::string interface.
It is strongly recommended to use std::string::erase if the start index is already checked, or otherwise known, to be in range. Otherwise, implement the index-size comparison instead of using this function.