Page 1 of 1

How to convert string to stringw

Posted: Sat Jan 15, 2011 7:05 pm
by Go|iath
...so yea,

how can I convert string to stringw ?

I've looked around for about 1 or 2 hours (I stopped counting the time once I became insane) and I can't still figure this out.

...thanks for any help.

...if anyone got pills against insanity I would use some right now.


PS : any info on how to convert a float/int to a stringw would also solve my problem.

Posted: Sat Jan 15, 2011 7:35 pm
by Go|iath
I never asked this question.

...this was a joke.

Stop looking at me.

Code: Select all

float fltvalue = 20.00001;
irr::core::stringw myString = "Float value = ";
myString += fltvalue;

Posted: Sat Jan 15, 2011 7:38 pm
by Radikalizm
For anyone still interested in doing these conversions instead of directly assigning the values:

Both int/floating point conversion and stringc to stringw conversion are done the same way

Code: Select all

// The two strings
core::stringc string1;
core::stringw string2;

// Assign a value to the first string
string1 = "This is a string";

// Convert the first string to a wide string
string2 = core::stringw(string1);