There is no extra space bcz in every round of loop we are always adding spaces to the original text…
It is in your demo view.
The text will be always like this
What you see: “test”
What is it actually:
"*empty-string*t*empty-string*e*empty-string*s*empty-string*t*empty-string*"
You can see at the beginning and and the end there are empty strings. It will turn to spaces. You will need to trim.
there are alot of methods to trim or to get the results by using some other tricks
here is one of them with total of 40 blocks still very less
Why not using the trim method
i think it will increse blocks and can be done with 44 or 43 blocks
for efficieny of trim method i think we first have to convert string into list
otherwise it may consume 43…44 blocks.
thats why i used this one
may be some other way that has been hidden from my sight can solve it with even more less blocks
m not sure.
What I mean is this is s very good method, but add trim method after replacing text.
yes i know its good but how can u set parametrs for trim
when u try u will have to check starting point of your trim and where u want to end
and in order to set these parameters u will have to use more blocks
i already have tried , i have tried 10 methods all of them results in almost 43+ blocks but latest that i have posted has only 40 blocks
may be u can even lessen thses blocks with trim method … but i did not succeed
oooh got your point
thats best …now we have fully optimized solution
thanks for trim method
@bodymindpower great work
@Don_Njondanmakal now u can mark the above post of @bodymindpower as solution
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.