Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kburns
Visitor

Casting / converting) from int to string (file under n00b)

Sorry for the heavily n00b'ed question (I'm sure I'll have more to come).

I am trying to covert an int to string (generating a random hex number)
Along the way I did something like this for debugging.

    foofoofoo = "#" + str(5) + "0" + str(5) + "0" + str(5) + "0" 
Print foofoofoo


Each time this is printed out with a space in front of each 5.
The printed string looks like:

# 50 50 50


Any ideas why these spaces are in there?
And more importantly how can I eliminate the spaces?
0 Kudos
1 REPLY 1
RokuChris
Roku Employee
Roku Employee

Re: Casting / converting) from int to string (file under n00

The space is where the sign would go if the number were negative. The ToStr() function, documented on p42 of the BrightScript Reference Manual will not add that space.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.