Raised This Month: $ Target: $400
 0% 

Retrieving a line from a string.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 06-27-2010 , 11:53   Retrieving a line from a string.
Reply With Quote #1

What I want is retrieve a line from a string, but the problem is that the string has a couple of lines, so what can I do?
__________________
"There is no knowledge, that is not power"
fezh is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-27-2010 , 12:51   Re: Retrieving a line from a string.
Reply With Quote #2

Emmm i am not sure but... doing a contain "^n" wouldn't work?

EDIT: Wait, try looping all chars and use equal betwen the character found and 0xA (LF ASCII character http://www.asciitable.com)
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...

Last edited by Alucard^; 06-27-2010 at 12:56.
Alucard^ is offline
Send a message via Skype™ to Alucard^
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 06-27-2010 , 12:59   Re: Retrieving a line from a string.
Reply With Quote #3

Quote:
Originally Posted by fezh View Post
What I want is retrieve a line from a string, but the problem is that the string has a couple of lines, so what can I do?
You can iterate within the array and make a new string with each character until ^n was found (^n = 13)

You can also use strtok or other string functions to split and get each line.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
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 14:50.


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