mIRC Home    About    Download    Register    News    Help

Print Thread
String manipulation question #249122 15/11/14 08:32 AM
Joined: Sep 2014
Posts: 259
S
Sakana Offline OP
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
I have the following string

"dota2.exe 9252 Console 1 716.304 KB"

I only want to return 716.304 KB (all the numbers are dynamic). I can't figure out how to manipulate the string since it's not static. Can I somehow use $5- for this?

Re: String manipulation question [Re: Sakana] #249123 15/11/14 08:36 AM
Joined: Nov 2014
Posts: 149
J
JuanAm Offline
Vogon poet
Offline
Vogon poet
J
Joined: Nov 2014
Posts: 149
Try this:
Code:
$gettok($5-,5-,32)

Re: String manipulation question [Re: JuanAm] #249125 15/11/14 08:39 AM
Joined: Mar 2010
Posts: 145
Masoud Offline
Vogon poet
Offline
Vogon poet
Joined: Mar 2010
Posts: 145
Originally Posted By: JuanAm
Try this:
Code:
$gettok($5-,5-,32)


Guess that was supposed to be: $gettok($1-, 5-, 32)


Nothing...
Re: String manipulation question [Re: Masoud] #249126 15/11/14 08:55 AM
Joined: Nov 2014
Posts: 149
J
JuanAm Offline
Vogon poet
Offline
Vogon poet
J
Joined: Nov 2014
Posts: 149
Originally Posted By: Masoud
Originally Posted By: JuanAm
Try this:
Code:
$gettok($5-,5-,32)


Guess that was supposed to be: $gettok($1-, 5-, 32)


I understood that the string "dota2.exe Console 9252 1 716304 KB" is given by $5-.
Now, if $5- shows only '716,304 KB', the code is as you say.

Re: String manipulation question [Re: JuanAm] #249127 15/11/14 08:57 AM
Joined: Sep 2014
Posts: 259
S
Sakana Offline OP
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Thanks, got it working 8)