Forum

> > CS2D > Scripts > Removing latters from the string
Forums overviewCS2D overview Scripts overviewLog in to reply

English Removing latters from the string

7 replies
To the start Previous 1 Next To the start

old Removing latters from the string

Infinite Rain
Reviewer Off Offline

Quote
Guys how can I remove words from string?

Example:
1
2
3
4
5
6
7
function remove(stringg, word)
	stringg = string.lower(stringg)
	word = string.lower(word)
	if string.find(stringg, word) ~= nil then
		remove_word(stringg, word)
	end
end

Please reply
Thanks

old Re: Removing latters from the string

Apache uwu
User Off Offline

Quote
You will need to loop this so it removes all of them...

1
2
3
4
5
6
7
8
9
function remove(stringg, word)
	while string.find(stringg,word)~=nil do
    		stringg = string.lower(stringg)
     		word = string.lower(word)
    		 if string.find(stringg, word) ~= nil then
          		remove_word(stringg, word)
    		 end
	end
end

"Dollororem ipsum quia dolor sit amet"
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview