Advertisement
RagingGam0r

Remove comments from LUA script

Oct 15th, 2020
2,835
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2.  
  3. test = "bruh--[[ comment ]] lol"
  4. NewText = ""
  5. IsComment = False
  6. for i,v in enumerate(test):
  7.   if (str(test[i:i+1]) == "-") and (str(test[i+1:i+2]) == "-"):
  8.     IsComment = True
  9.   elif (str(test[i-2:i-1]) == "]") and (str(test[i-1:i]) == "]"):
  10.     IsComment = False
  11.   if IsComment == False:
  12.     NewText = NewText + str(v)
  13.  
  14. print(NewText)
  15.  
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement