Sidebar

Iterate through OBX, substring if an asterisk exists

0 votes
293 views
asked Jun 15, 2017 by cliff-s-2873 (240 points)
I have this so far but am not able to get the substring portion to work.

if (StringUtils.containsIgnoreCase(message.getNode('OBX['+(i+1)+']-6.1'), '*'))  {
            message.setNode('OBX['+(i+1)+']-6.1',StringUtils.substringAfter('OBX['+(i+1)+']-6.1', '*'));

1 Answer

0 votes

It appears that you need to get the node on the second line: using 'message.getNode('

if (StringUtils.containsIgnoreCase(message.getNode('OBX['+(i+1)+']-6.1'), '*'))  {
            message.setNode('OBX['+(i+1)+']-6.1',StringUtils.substringAfter(message.getNode('OBX['+(i+1)+']-6.1'), '*'));
}

answered Jun 15, 2017 by ben-s-7515 (12,640 points)
...