how do i find something in text


ok, love language, something's been bit of pain me, , cant find in documentation....

if have string, how program recognise formatting.

for example, if want program interpret list, , break down:

"sausages, ham, bacon"

how program recognise comma list seperator,

or lets want length of string, or want split off every second char seperate var...

ok, love language, something's been bit of pain me, , cant find in documentation....

if have string, how program recognise formatting.

for example, if want program interpret list, , break down:

"sausages, ham, bacon"

how program recognise comma list seperator,

or lets want length of string, or want split off every second char seperate var...


choo, not sure you're looking exactly, but...

to split string based on sub-string, you'd this:

split=","  string = "one,two,three,four" result = "" splitit()  item=1 array.getitemcount(result)   textwindow.writeline(result[item]) endfor    sub splitit while text.issubtext(string, split)   result[array.getitemcount(result) + 1] = text.getsubtext(string, 1, text.getindexof(string, split) - 1)   string = text.getsubtexttoend(string, text.getindexof(string, split) + 1) endwhile endsub
notice above generates array (named 'result') initial string, re-use split values reference them in array.

to split string every second char have either done using array hold 2 char results, or you'd have manually if wanted put values actual variables, like...

string = "aabbccddeeff"

a = text.getsubtext(string, 1, 2)
b = text.getsubtext(string, 3, 2)
etc.

anyway, hope close wanted. or maybe you're asking sort of regularexpression feature, sb doesn't have.


Learning  >  Small Basic



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........