![]() ![]() I tried to have a look at the boost::split code:īut I fear I'm not familiar enough with boost / c to really grasp why it is (that much) faster. ![]() Would you please be so kind as to explain how ropes could help make this faster?įor the record, I just learnt about them by you mentioning them, but wikipedia compares them to array-based strings: (data_structure)#Comparison_with_monolithic_arraysįrom other articles, it seems like ropes only become beneficial when used on large strings, so it seems (like usual) there is no "one fastest way", it depends on the size of string you're intending to split. I really should make some time to read through all of the articles in there. Thanks very much for your link to that faq-entry Duoas, very informative and well written as always. Perhaps one of the experts around here could give a better, perhaps more low level approach that would be faster. Don't forget to turn on your compiler's optimizations too. Note that I haven't benchmarked it, I thought I'd leave comparison up to you since it would make more sense to compare to your existing results. Split (',') //seperate the hobbies by comma. 1,231 views C split method returns an array of strings, each of which is a substring of string formed by splitting it on boundaries formed by the string delimiter. Std::copy(container.cbegin(), container.cend(), ostr_it) C Split String By Comma - ballfasr Split String in C and Store It in Array. Std::ostream_iterator ostr_it(std::cout, "\n") ![]() While (end container = string_split(s, ',') Std::vector string_split(std::string s, const char delimiter) ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |