AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Retrieving a line from a string. (https://forums.alliedmods.net/showthread.php?t=130783)

fezh 06-27-2010 11:53

Retrieving a line from a string.
 
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?

Alucard^ 06-27-2010 12:51

Re: Retrieving a line from a string.
 
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)

joropito 06-27-2010 12:59

Re: Retrieving a line from a string.
 
Quote:

Originally Posted by fezh (Post 1221553)
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.


All times are GMT -4. The time now is 14:50.

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