On 1 June 2011 03:38, testerinCO <cmola...@comcast.net> wrote:
> Hello
>
> I'm using the time function and get the following string returned:
> currentTime=1306894971042.  I'm interested in only the first 10 digits.
>
> I tried the following:
>
> ${__jexl(Systemclass=log.class.forName("java.lang.System");
> Stringclass=log.class.forName("java.lang.String");
> now=Stringclass.valueOf(Systemclass.currentTimeMillis()).substring(2);)}
>
> The substring doesn't accept  "from" to "to" integers (i.e. 0, 9)

Yes it does, but you have to escape the comma.

Try

${__jexl(s="${__time()}";s.substring(0\,9))}

Jexl does not like "1234567890".substring(0,9) so you have to assign
to a variable first.

> I've tried different iterations of javascript, but can't get jmeter to read
> the file and the function within it.
>
> Thank you.
>
> --
> View this message in context: 
> http://jmeter.512774.n5.nabble.com/How-to-get-substring-function-in-jMeter-tp526607p4444003.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscr...@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-h...@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscr...@jakarta.apache.org
For additional commands, e-mail: jmeter-user-h...@jakarta.apache.org

Reply via email to