Hi. Can someone please help me how to split this string message.
something like this
213444
ri1
CQ
Best regards Niclas
Hi. Can someone please help me how to split this string message.
something like this
213444
ri1
CQ
Best regards Niclas
Do you need all of the parts?
Sorry, I see you do!
No actually I just need /CQ but it can also end with /BA02 so need everything after the last /
I don't need the / just CQ
Is the start of the string always the same length up till the last "/"?
Not sure. But i think so.
Have you searched for how to split strings in JavaScript? There are lots of guides online and it may be worth spending a little time learning some of the basics of JavaScript string handling.
You could try the switch node and search for /CQ or /BA02.
I can't just search for /CQ or /BA02. I can be hundreds of different combinations.
Can I use some function that just shows the message after the 14 character?
You just posted exactly what you require, this should have been your first post!!
Can you specify what the structure of the string is then? Is it always the same length? Does it always have some characters consistently in the same place?
I don´t really know if this will work. But it will be worth a try. Most of all i want the whole message I three different parts. But if know how to accomplish the 14 character I will try with this before I figure out how to do it.
This is the code an alarmsystem send to the alarm central. 213444 is the costumer number. ri1 is area 1 and CQ is a sia that stands for disarmed. BA02 stands for BurglerAlarm on section 2
So I think the length is the same as long that you don't use mere than 9 areas
I think you should follow this advice.
Go read about String.substring() and String.split() on the mdn website.
I will do that!! Thanks for the advice!
Have a look at slice() - https://www.w3schools.com/jsref/jsref_slice_string.asp
I used it in this example -Reading String of Hex from T-zone RD05 problem