How to remove the first or last space from a string
yanbin
Posts: 86
For example, I have a string str= ' this is a string ', there are spaces at the beginning and the end of this string, how can I remove it in Netlinx studio?
Thanks
Thanks
0
Comments
Thanks Auser!
Will this command work? send_command TP,"'TEXT1,2,3,5-CD'"
I've just updated that code snippet to include a definition for the horizontal tab ASCII character which I had inadvertently omitted.
BMF can do this too (I think) but the ^TXT is a bit simpler.
So Send-command tp,"'^TXT-1&2&3&5,1&2,Test only'" will send text to button 1,2,3 and 5?
I would write it like this: I would use the . (dot) operator so 1 through 3 (1.3) and 5 (&5) and for states 0 equals states 1 & 2.
Question: Is there a way to remove the spaces before or after characters in a string?
Answer: TRIM_STRING
Question: Is there a way to search for characters in a string starting at the end?
Answer: FIND_STRING_REV
Question: Is there a way to replace specific characters, or remove specific characters, from a string?
Answer: REPLACE_STRING
Question: Is there a way to assign sub-strings separated by delimiters from a string to an array?
Answer: SPLIT_STRING
Question: Is there a way to count the number of times a pattern of characters occurs in a string?
Answer: COUNT_STRING
the variable text channels are random, they can be 1,3,5,7,10, how to send text to them?
I tested it with AXD-CV6 and a MVP5200i, send_command tp,"'^TXT-1&3&5&7&10,0,Text Only'" work in MVP5200i but not AXD-CV6, I checked the AXD-CV6 manual, could not find any multiple send text command.
MVP5200i = G4
^TXT is a G4 command
Aren't the differences between G3 and G4 panels distinguished well enough in the course of AMX training? If not - it should be.
I realized the difference between G3 and G4 panels, I just want to find a command can do both G3 and G4 panels.