AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   what does replace() funtion returns (https://forums.alliedmods.net/showthread.php?t=10377)

kaboomkazoom 02-17-2005 17:15

what does replace() funtion returns
 
someone please tell me what does the replace function returns.

also please tell me how can i replace multiple occurances of any sub-string in any give string ( i dont know the no. of occurances of the sub-string beforehand ) because replace() replaces only 1st occurance.

XxAvalanchexX 02-17-2005 18:06

replace() always returns 0. And are you sure that it will replace only the first occurance? Perhaps you could do this:

Code:
while(containi(stringval,"value") != -1) {   stringval = replace(stringval,"value","otherstuff"); }

kaboomkazoom 02-17-2005 18:09

thanks
 
ya this will surely work.

thanks


All times are GMT -4. The time now is 19:18.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.