Raised This Month: $ Target: $400
 0% 

Solved Need help with strings


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thEsp
BANNED
Join Date: Aug 2017
Old 01-07-2019 , 14:09   Need help with strings
Reply With Quote #1

Greetings,
I have an problem reading strings. I want to execute a command if an strings starts with x specific letter.

For example:
PHP Code:
if(string_startswith(stringOne,";")) {


Im using this:
PHP Code:
if(containi(stringOne,";")) {


But this checks if string has a custom x letter/string rather than checking if it starts with it.
Thanks in advance

Solution: if(equal(string,";",1))

Last edited by thEsp; 03-23-2019 at 07:54.
thEsp is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 01-07-2019 , 14:21   Re: Need help with strings
Reply With Quote #2

Code:
hi[6] = "hello" hi[0] = "h" hi[1] = "e" hi[2] = "l" hi[3] = "l" hi[4] = "o"
You get what I mean?
__________________
Relaxing is offline
Old 01-07-2019, 14:22
thEsp
This message has been deleted by thEsp.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-07-2019 , 14:39   Re: Need help with strings
Reply With Quote #3

PHP Code:
if(string[0] == ';'
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 01-07-2019 , 14:39   Re: Need help with strings
Reply With Quote #4

Code:
if (buffer[0] == 'x') // something
__________________








CrazY. is offline
Old 01-07-2019, 15:23
thEsp
This message has been deleted by thEsp.
Reply


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 07:35.


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