AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Find and Replace letter/string (https://forums.alliedmods.net/showthread.php?t=307187)

iceeedr 04-30-2018 00:38

Find and Replace letter/string
 
Hello masters, how could I change a word or letter from a string? Delete only the letter and not the entire string.

I created the example below only for understanding.

PHP Code:

get_cvar_string("hostname",OldHostName,charsmax(OldHostName))
    
if(
containi(OldHostName"blablabla")
{
    
/// ??? 


Airkish 04-30-2018 03:11

Re: Find and Replace letter/string
 
PHP Code:

replace_all(OldHostNamecharsmax(OldHostName), "Word/Letter""Replacement"); 


instinctpt1 04-30-2018 06:26

Re: Find and Replace letter/string
 
PHP Code:

replace_string(OldHostNamecharsmax(OldHostName), "blablabla""To replace with.."false

Read here

iceeedr 04-30-2018 10:14

Re: Find and Replace letter/string
 
Quote:

Originally Posted by Airkish (Post 2590067)
PHP Code:

replace_all(OldHostNamecharsmax(OldHostName), "Word/Letter""Replacement"); 


Thanks, it works.

Quote:

Originally Posted by instinctpt1 (Post 2590086)
PHP Code:

replace_string(OldHostNamecharsmax(OldHostName), "blablabla""To replace with.."false

Read here

Thanks, did not know of the replace_string.

EFFx 04-30-2018 10:36

Re: Find and Replace letter/string
 
Ue, a pessoa cria um pug e não sabe editar os bagui? Hilário.

iceeedr 04-30-2018 10:41

Re: Find and Replace letter/string
 
Quote:

Originally Posted by EFFx (Post 2590138)
Ue, a pessoa cria um pug e não sabe editar os bagui? Hilário.

Vai cortar os pulsos na esquina, estou com um projeto nada relacionado a pug ;*

Do not bother me in a closed topic.

EFFx 04-30-2018 15:26

Re: Find and Replace letter/string
 
Ui, CRIANDO UM PROJETO KKKKKKKKKKKKKKKKKj, c nem sabe fazer plugins corno, tudo copiado pra dizer que fez. Cuidado pra sua mulher te deixar com dois chifres e pesando 120 kilos em KKKKKKKKJ.


All times are GMT -4. The time now is 04:44.

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