Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-26-2007, 02:32 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Tokenize / Removing characters

I want to save a string with saveLines(), when I use tokenize("\n"); to remove the '\n' all it does is escape it ('\\n'); How do I get rid of the '\n' all together to make an array?
Reply With Quote
  #2  
Old 03-26-2007, 02:46 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Err, what? O.o
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #3  
Old 03-26-2007, 04:53 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Post the code?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #4  
Old 03-26-2007, 06:00 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
\n makes a line break in the code... just add a new line if your saving to some file
__________________
Deep into the Darkness peering...
Reply With Quote
  #5  
Old 03-26-2007, 08:22 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by Rapidwolve View Post
I want to save a string with saveLines(), when I use tokenize("\n"); to remove the '\n' all it does is escape it ('\\n'); How do I get rid of the '\n' all together to make an array?
PHP Code:
tokens = var.tokenize("\\n"); 
That should work, Try it.
__________________
What signature? I see no signature?
Reply With Quote
  #6  
Old 03-26-2007, 08:43 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by Angel_Light View Post
\n makes a line break in the code... just add a new line if your saving to some file
Oh really? I didn't know that I just randomly decided to put '\n' in the text parser -_-
just kidding, yes i know

Quote:
Originally Posted by godofwarares View Post
PHP Code:
tokens = var.tokenize("\\n"); 
That should work, Try it.
Seems like it should, I'll try

Edit, now its taking away all N's along with the \n's and when I do \\\n it works but it adds an n to the beggining of each array but the first one

Last edited by Rapidwolve; 03-26-2007 at 08:53 PM..
Reply With Quote
  #7  
Old 03-30-2007, 11:37 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Well if all else fails you could make a parser yourself.
I've never encountered this problem so I can't really help much, sorry.
PHP Code:
public function replaceSubstring(stringpositionlengthnewstring) {
  
temp.stringa;
  
temp.stringb;
  
temp.outstring;
  
  if (
position 0) {
    return;
  }
  
stringa string.substring(0position);
  
stringb string.substring(position length, -1);
  
outstring stringa newstring stringb;
  return 
outstring;

You can find instances of "\\n" with a function and edit them out with that function I posted if you wish.
__________________
Reply With Quote
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 +2. The time now is 11:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.