AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Reading File Problem with spaces (https://forums.alliedmods.net/showthread.php?t=152913)

DjOptimuS 03-16-2011 08:08

Reading File Problem with spaces
 
Hello,

I am trying to do a gather plugin, much like MatchMod Deluxe but with commands changed, and made from scratch.

i use read_file to read a file called admini.ini in free translation what will be admins.ini

there are only steamid's listed one below another limited by MAX_ADMINS 200

The problem is that when i read a line, it stores me with, i think, 2 or 3 spaces in front of the string.

i tried to use replace to get rid of these spaces, but no chance, any ideeas how to read a file line by line without the inexistent spaces in front of them ?

Replace doesn't seems to recognize that spaces, because i tried to replace " " with "" and no result.

Thank you.

Arkshine 03-16-2011 08:18

Re: Reading File Problem with spaces
 
use trim() before. It will remove all kind of spaces at left/right.


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

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