Jump to content




remove spaces between strings?


  • You cannot reply to this topic
4 replies to this topic

#1 gergo654

  • Members
  • 8 posts

Posted 01 June 2016 - 02:44 PM

I am working on a "lua console faker" program and it reads what the user types in (local input = read() ) it does not print out the working
directory when you type in cd rom for example so I was wondering if I can like remove the spaces between the two strings.
Example:.
wdir = shell.dir()
print(wdir,">")
but the output is for example:
rom > .
i would like to print this like this:
rom>

Edited by gergo654, 01 June 2016 - 03:06 PM.


#2 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 01 June 2016 - 03:01 PM

Assuming you meant shell.dir (since fs.dir doesn't exist), I cannot reproduce your results.

http://imgur.com/1GxI4sU

#3 gergo654

  • Members
  • 8 posts

Posted 01 June 2016 - 03:06 PM

thx i just fixed it :S
and idk why I typed in the same command and i got this:
http://imgur.com/gooIyFl

Edited by gergo654, 01 June 2016 - 03:45 PM.


#4 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 01 June 2016 - 09:29 PM

That's because in the latest CC versions print() was changed to add spaces between each argument. Just concatenate the strings to remove the space:

print(shell.dir() .. ">")


#5 gergo654

  • Members
  • 8 posts

Posted 02 June 2016 - 04:03 PM

thank you :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users