|
braumen Beginner
Joined: 28 May 2002 Posts: 17 Location: USA
|
Posted: Wed May 29, 2002 2:32 am
2 ?s concerning variables |
1: how can i remove something from a variable IE: the word TEST is in the variable TESTING.... how can i remove the word from the variable
2: How can i replace words in a variable with a new word IE: the word TEST is inthe variable TESTING. How can i replace TEST with NOTEST?
Thanks! |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed May 29, 2002 2:41 am |
1. For a normal variable, just set it to a nullstring.
testing = %null
testing := ""
#VAR testing {}
2. Just reassign the value
#VAR TESTING NOTEST
LightBulb
Vague questions get vague answers |
|
|
|
braumen Beginner
Joined: 28 May 2002 Posts: 17 Location: USA
|
Posted: Wed May 29, 2002 2:44 am |
ok i got that.... now how do i keep the rest of the things i have in the variable:
example: variable TESTING has text TEST and NOW i want to get rid of TEST but keep NOW
asme for replacing: i want to replace TEST with NOTEST and keep NOW in the variable.... |
|
|
|
dacheeba Adept
Joined: 29 Oct 2001 Posts: 250
|
Posted: Wed May 29, 2002 3:42 am |
Is it a regular variable with the text TEST and NOW in it, or a stringlist variable? IE:
testing = TEST and NOW ?
If this is the case, the best thing to do isset the variable to just NOW like this:
1.testing = NOW
2.#VAR testing {NOW}
If its a stringlist, IE:
testing = TEST|NOW
There are a number of ways to do it, but the easist would be:
1.#DELI testing TEST
2.#DELNITEM testing 1
The second one will remove the first value of the stringlist, you could change it to 2 and it would delete NOW.
There also a huge number of functions that do the same things, allowing for better composed scripting. You really should check the help files and learn the scripting language a bit. |
|
|
|
|
|