Raised This Month: $ Target: $400
 0% 

Solved Replace in a String that Contains Repeated Chars


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 07-21-2022 , 08:03   Re: Replace in a String that Contains Repeated Chars
Reply With Quote #14

Quote:
Originally Posted by asdian View Post
thanks for your answer guys, it all works as i need now.

one last question, is it possible to get 2 chars or more like :
Code:
szCos[strlen(szCos)-4] == "this"
without using equal/equali in amxx ?
Yes, by using the logical operator "&&" ( AND )

Code:
// By defining a new variable which stores the string lenght, you avoid multiple function calls ( improving the performance ) new iLen = strlen(szCos) if(szCos[iLen - 4] == 't' && szCos[iLen - 3] == 'h' && szCos[iLen - 2] == 'i' && szCos[iLen - 1] == 's') {     // meets the criterias, execute }
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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