Raised This Month: $ Target: $400
 0% 

Solved new line char


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-18-2017 , 12:38   Re: new line char
Reply With Quote #1

Use trim().
klippy is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 07-20-2017 , 07:02   Re: new line char
Reply With Quote #2

Quote:
Originally Posted by KliPPy View Post
Use trim().
Thanks you, I forgot about this.
Code:
if(equal(text, "line1") // why this returns true if text contains actually a "line^n"

Last edited by KiLLeR.; 07-20-2017 at 07:04.
KiLLeR. is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 07-20-2017 , 08:14   Re: new line char
Reply With Quote #3

Quote:
Originally Posted by KiLLeR. View Post
Thanks you, I forgot about this.
Code:
if(equal(text, "line1") // why this returns true if text contains actually a "line^n"
You could also use if (text[0] == EOS ...) .
EOS is for new line(empty).
DarthMan is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-20-2017 , 09:18   Re: new line char
Reply With Quote #4

Quote:
Originally Posted by DarthMan View Post
You could also use if (text[0] == EOS ...) .
EOS is for new line(empty).
Or simply
Code:
if( ! text[ 0 ] )
__________________
edon1337 is offline
Reply



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 22:44.


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