LT-Keywords
The following keywords are defined for string processing in LabTalk:
This example shows how to use quotes inside a string in LabTalk
str$="expression=%(quote)col(1)=col(2)+1%(quote)"; str$=;// should print "expression="col(1)=col(2)+1"" int i = str.Find('"'); i=;//-->12 // same as '"' when used as a string function argument: i=str.Find(quote, i+1); i=;//-->28 i=str.Count('"'); i=;//-->2 i=str.Count(quote); i=;//--> also 2
Similar issues exist for new lines,
str$="line1%(CRLF)line2%(CRLF)line3"; type str$; type "str has $(str.GetNumTokens(CRLF)) lines"; //should print: //line1 //line2 //line3 //str has 3 lines
In this example, system List Separator is comma (",")
string str1="abc;efg,fjk"; int nn = str1.GetNumTokens(SLIST); nn = ; for(i=1;i<=nn;i++) { string str$ = str1.GetToken(i, SLIST)$; type "$(i): %(str$)"; } // should print // nn=2 // 1: abc;efg // 2: fjk