Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   A lil help w/ Substrings (https://forums.graalonline.com/forums/showthread.php?t=67015)

KuJi 06-28-2006 10:48 PM

A lil help w/ Substrings
 
Well.. heres whats up:
makevar("test." @ tokens[0]) = "hi";
tokens[0] contains of test.a=B

so I would need it to look like this:
makevar("test.a") = "B"; (test.a = B)

Normally I could just substirng it, but the tokens could always change. How can I detect where the = is and get the content before and after the sign?

Thanks. :)

JustBreathe 06-29-2006 12:50 AM

temp.a = "temp.b = 3";
echo( temp.a.substring( 0 , temp.a.pos("=") ) );

? Might that what you be searching for?

KuJi 06-29-2006 04:43 AM

Quote:

Originally Posted by JustBreathe
temp.a = "temp.b = 3";
echo( temp.a.substring( 0 , temp.a.pos("=") ) );

? Might that what you be searching for?

Thanks a ton, never knew about the pos command.

zokemon 07-05-2006 08:16 AM

Quote:

Originally Posted by KuJi
Thanks a ton, never knew about the pos command.

Such the wiki my friend :)
(pos() is a function also ;o)


All times are GMT +2. The time now is 03:54 PM.

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