Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
lumpenprole
Level 7

Potential bug on StrI()

So, it seems that StrI() introduces a leading whitespace, whereas ToStr() does not. Just thought I'd let someone know.
0 Kudos
4 Replies
Roku Employee
Roku Employee

Re: Potential bug on StrI()

0 Kudos
belltown
Level 7

Re: Potential bug on StrI()

"lumpenprole" wrote:
So, it seems that StrI() introduces a leading whitespace, whereas ToStr() does not. Just thought I'd let someone know.

I don't think I've ever used Strl(), for that reason.
https://github.com/belltown/
0 Kudos
Komag
Level 9

Re: Potential bug on StrI()

When you print to console, it apparently uses StrI(), so I'm in the habit of avoiding spaces since it will add one, such as:
PRINT "x is" x ", y is" y
instead of
PRINT "x is " x ", y is " y
0 Kudos
TheEndless
Level 7

Re: Potential bug on StrI()

The extra space is for the sign. If you use it on a negative integer, there won't be an empty space. I almost always use .ToStr(), but you could always wrap the StrI()/Str() call in a Trim() to strip the white space.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos