This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

How to strip certain part of a string from a variable.

Old posts that have not been replied to for several years.
Locked
k
kailion
Voice
Posts: 2
Joined: Tue Jun 21, 2005 8:47 pm

How to strip certain part of a string from a variable.

Post by kailion »

Lets say

$result = "Partial Movement", "", "Nothing", "Nothing",

While the "Partial movement" will definitely vary between a 2-5 words value, was wondering how would I get rid of everything after the the very first ,.

So that $result would be just "Partial Movement". Also i understand that the " may cause eggdrop to have syntax errors so how would I proceed to remove the " after seperating the rest of the string after the first ,.

Thanks
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

set result [string replace $result [string first , $result] end]
Locked