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: 
squirreltown
Roku Guru

StrReplace

I need to remove a substring from the middle of a string.
str = (123xyz567)
need to remove "xyz"

The strReplace function in StringUtils.brs doesn't actually replace just the string, it replaces it AND removes everything after it, not what i need.

Thanks
Kinetics Screensavers
0 Kudos
2 REPLIES 2
RokuMarkn
Visitor

Re: StrReplace

StrReplace seems to work for me

BrightScript Debugger> print StrReplace("123xyz567", "xyz", "")
123567


--Mark
0 Kudos
squirreltown
Roku Guru

Re: StrReplace

Thank you Mark, that works for me too. I was over-thinking and trying to print from inside that function. Again thinking too much, i knew it had to be simple.
Kinetics Screensavers
0 Kudos