Home » Community » Newbie corner » From std::string to String
Re: From std::string to String [message #49460 is a reply to message #49458] |
Wed, 14 February 2018 21:20 |
|
Klugier
Messages: 1076 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
Try to create Upp::String basing on std::string like this:
IMO, you should use Core library to deal with text files. The easiest way is to use LoadFile(path):
Upp::String fileContent = Upp::LoadFile("PathToTextFile.txt");
// now you could use some powerfull functions from Core like Split;
Upp::Vector<String> fileContentLines = Upp::Split(fileContent, "\n");
for (const String& line : fileContentLines) {
// Loop over the line...
}
I will start from rewriting you code from standard library into Upp approch. This could save you problems with file encoding conversion.
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Wed, 14 February 2018 21:27] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue May 07 19:15:43 CEST 2024
Total time taken to generate the page: 0.02732 seconds
|