String matching: Difference between revisions
Content added Content deleted
(→{{header|Lang5}}: add.) |
|||
Line 820: | Line 820: | ||
[[File:LabVIEW_Character_matching_2.png]]<br/> |
[[File:LabVIEW_Character_matching_2.png]]<br/> |
||
[[File:LabVIEW_Character_matching_3.png]] |
[[File:LabVIEW_Character_matching_3.png]] |
||
=={{header|Lang5}}== |
|||
<lang lang5>: bi* '_ set dip _ execute ; : bi@ dup bi* ; |
|||
: comb "" split ; : concat "" join ; |
|||
: dip swap '_ set execute _ ; : flip comb reverse concat ; |
|||
: contains |
|||
"comb length" bi@ swap 4 3 _roll 2 compress reshape # create a matrix. |
|||
: concat.(*) concat ; |
|||
'concat "'concat. apply" bi* eq [1] index collapse |
|||
length if expand drop else drop 0 then ; # result. |
|||
: end-with 'flip bi@ start-with ; |
|||
: start-with 'comb bi@ length rot swap iota subscript 'concat bi@ eq ; |
|||
"rosettacode" "rosetta" start-with . # 1 |
|||
"rosettacode" "taco" contains . # 4 |
|||
"rosettacode" "ocat" contains . # 0 |
|||
"rosettacode" "edoc" end-with . # 0</lang> |
|||
=={{header|Liberty BASIC}}== |
=={{header|Liberty BASIC}}== |
||
<lang lb>'1---Determining if the first string starts with second string |
<lang lb>'1---Determining if the first string starts with second string |