String matching: Difference between revisions
Content added Content deleted
Line 885: | Line 885: | ||
=={{header|Elena}}== |
=={{header|Elena}}== |
||
ELENA 3.2 : |
|||
<lang elena> |
<lang elena>import extensions. |
||
program = |
program = |
||
Line 891: | Line 892: | ||
var s := "abcd". |
var s := "abcd". |
||
console |
console printLine(s," starts with ab: ",s startingWith:"ab"). |
||
console |
console printLine(s," starts with cd: ",s startingWith:"cd"). |
||
console |
console printLine(s," ends with ab: ",s endingWith:"ab"). |
||
console |
console printLine(s," ends with cd: ",s endingWith:"cd"). |
||
console |
console printLine(s," contains ab: ",s containing:"ab"). |
||
console |
console printLine(s," contains bc: ",s containing:"bc"). |
||
console |
console printLine(s," contains cd: ",s containing:"cd"). |
||
console |
console printLine(s," contains az: ",s containing:"az"). |
||
console |
console printLine(s," index of az: ",s indexOf:"az" at:0). |
||
console |
console printLine(s," index of cd: ",s indexOf:"cd" at:0). |
||
console |
console printLine(s," index of bc: ",s indexOf:"bc" at:0). |
||
console |
console printLine(s," index of ab: ",s indexOf:"ab" at:0). |
||
console readChar. |
console readChar. |