Conversion question

Can I convert from this representation

byte spaceship[8] = { B00000, B10000, B11100, B11111, B11100, B10000, B00000, };

to a String?

If not, how can I obtain the length of spaceship character? I'm sorry if I was not clear enough.

Why do you want to have it as String? What do you want to do with it? http://xyproblem.info/

And spaceship is not a character, it's a array. And if you meant spaceship figure then well, it's 7 by 5 bites.... (Why you declare 8 bytes for it I don't know...)

how can I obtain the length of spaceship character

What do you mean by length in this context ?

I'm making a simple game. I found an example on the internet that really helped me, but on that example they use a string for the spaceship, and therefore, for detecting collisions they use the spaceship's string length. But I want to create a spaceship of my own, using createChar, but I can't figure it out how to get the length of it, so I can use it to detect collisions.

Then post that code. Because now everything can just mean everything. A string (which is NOT the same as a String) for an object doesn’t really make sens to me now.

Writing code is about knowing what you do, no just copy pasting… And if you know what that code does fixing it will be pretty easy :wink:

I didn't copy paste it, I wrote it. And I mean String. I can post the code, but it's irrelevant, because I only wanted to know if such a conversion is possbile.

The conversion you talk about is ambiguous so no, it's not possible because we don't know what you expect.

And using a String as a figure in a game is madness....

Nevertheless, I have to thank you, because talking to you gave me the solution. Thank you. :D