Jump to content




How to print \ in Lua


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

#1 houseofkraft

  • Members
  • 170 posts
  • LocationUSA

Posted 11 December 2016 - 04:41 PM

So i am making some kind of loading animation and i want to print \

but i know \ means something special in Lua and it does not work.

Thanks

- House

#2 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 11 December 2016 - 04:49 PM

Just escape \ in the string:
print "Here you go -> \\"

This is used for some other stuff too. eg linebreaks:
print "line 1\nline2"
(Although I'm not sure if print implemented that)

Edited by H4X0RZ, 11 December 2016 - 04:50 PM.


#3 houseofkraft

  • Members
  • 170 posts
  • LocationUSA

Posted 14 December 2016 - 12:10 PM

Thanks.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users