Do anyone know How to Remove more than one Extra Space between the two lines?
Here I tried two ways :
1. trim() function But, It's only Removed a Left and right side space.
2. I apply to Replace(" ", "") But, It only works with the Single Space.
And one Logic apply From C# like below. It's Working :
' Console.WriteLine("HEllo World"); ' System.Text.RegularExpressions.RegexOptions options = System.Text.RegularExpressions.RegexOptions.None; ' System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("[ ]{2,}", options); ' string sentence = regex.Replace("HEllo World", " "); ' Console.WriteLine(sentence);
Same thing, I tried with Roku like below two ways:
'First
?"Hello World" r = CreateObject("roRegex", "\s+", "") sentence = r.Replace("HEllo World Google ", " ") print(sentence)
'Second pattern = CreateObject("roRegex", "[ ]{2,}", "i") patternsentence = pattern.Replace("HEllo World Google ", " ") print(patternsentence)
But Here It's Removing only First space in-between the two character like below :
HEllo World Google
Does anyone know How It's possible?
I forgot to heard about ReplaceAll Function. Now, It's working for me.
pattern = CreateObject("roRegex", "[ ]{2,}", "i") patternsentence = pattern.ReplaceAll("HEllo World Google ", " ") print(patternsentence)
I forgot to heard about ReplaceAll Function. Now, It's working for me.
pattern = CreateObject("roRegex", "[ ]{2,}", "i") patternsentence = pattern.ReplaceAll("HEllo World Google ", " ") print(patternsentence)
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
We're sorry for this disruption — we’re excited to share what’s next!