Re: [Pharo-users] Converting an Array of Characters to a String

2016-11-09 Thread Igor Stasenko
On 9 November 2016 at 07:49, Dimitris Chloupis wrote: > Not in C but there std::string in C++ similar to our String object. > > Strictly speaking , std::string is again not part of C++ per se, it comes from library that implements such class. > C char indeed is more a byte array than a string.

Re: [Pharo-users] Converting an Array of Characters to a String

2016-11-08 Thread Dimitris Chloupis
Not in C but there std::string in C++ similar to our String object. C char indeed is more a byte array than a string. Actually C won't allow to change the string value mainly because it thinks you try to change the size which something that is not allowed for arrays anyway, so the only way to chan

Re: [Pharo-users] Converting an Array of Characters to a String

2016-11-08 Thread Igor Stasenko
What i meant, i wanted to warn Dimitris that char[100] are just array of 100 characters (bytes in C).. and has nothing to do with strings. Do not confuse fixed-length C arrays with strings. There's no 'string' data type in C, and instead they use null-terminated character sequence as a convention.

Re: [Pharo-users] Converting an Array of Characters to a String

2016-11-08 Thread Igor Stasenko
On 8 November 2016 at 14:42, Esteban Lorenzano wrote: > (always with Char100 example in mind): > > s := MyStructure fromHandle: blah. > string := s data readString. > > should work. > > IIRC, #readString works correctly only for correctly null-terminated strings. If not, it will read beyond the

Re: [Pharo-users] Converting an Array of Characters to a String

2016-11-08 Thread Bernardo Ezequiel Contreras
something similar String withAll: { $a. Character space. $b }. On Tue, Nov 8, 2016 at 10:52 AM, Dimitris Chloupis wrote: > > > On Tue, Nov 8, 2016 at 3:42 PM Nicolai Hess wrote: > >> 2016-11-08 14:31 GMT+01:00 Dimitris Chloupis : >> >> I feel like stupid but I cannot find a way to convert an

Re: [Pharo-users] Converting an Array of Characters to a String

2016-11-08 Thread Dimitris Chloupis
On Tue, Nov 8, 2016 at 3:42 PM Nicolai Hess wrote: > 2016-11-08 14:31 GMT+01:00 Dimitris Chloupis : > > I feel like stupid but I cannot find a way to convert an Array of > Characters to a String , I can do with a do: and join characters converted > to strings to a single string but it feels too m

Re: [Pharo-users] Converting an Array of Characters to a String

2016-11-08 Thread Esteban Lorenzano
ah yes, that will work (I was thinking on UFFI and I answered that) :) > On 8 Nov 2016, at 14:41, Nicolai Hess wrote: > > > > 2016-11-08 14:31 GMT+01:00 Dimitris Chloupis >: > I feel like stupid but I cannot find a way to convert an Array of Characters > to a St

Re: [Pharo-users] Converting an Array of Characters to a String

2016-11-08 Thread Esteban Lorenzano
(always with Char100 example in mind): s := MyStructure fromHandle: blah. string := s data readString. should work. Esteban > On 8 Nov 2016, at 14:31, Dimitris Chloupis wrote: > > I feel like stupid but I cannot find a way to convert an Array of Characters > to a String , I can do with a d

Re: [Pharo-users] Converting an Array of Characters to a String

2016-11-08 Thread Nicolai Hess
2016-11-08 14:31 GMT+01:00 Dimitris Chloupis : > I feel like stupid but I cannot find a way to convert an Array of > Characters to a String , I can do with a do: and join characters converted > to strings to a single string but it feels too many steps. > > Is there a simpler way ? > String newFro