Skip to main content
1-Visitor
June 23, 2017
Solved

How to get substring functionality in thingworx javascript services?

  • June 23, 2017
  • 2 replies
  • 2941 views

Hi,

 

Please help to achieve sub string functionality in thingworx service.

 

Is there any snippet available please let us know.

 

 

 

Thanks

 

Anil Kesana

Best answer by wposner-2

The service editor will allow you to use most javascript functions.

var str = "Hello world!";
var res = str.substring(1, 4);

the result will be "ell"

2 replies

5-Regular Member
June 23, 2017

Hi Anil Kesana​,

I think for SubString; normal JavaScript would work. Are you getting any error?

wposner-21-VisitorAnswer
1-Visitor
June 23, 2017

The service editor will allow you to use most javascript functions.

var str = "Hello world!";
var res = str.substring(1, 4);

the result will be "ell"