Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -1,15 +1,8 @@
|
|||
/*REXX program demonstrates testing (modeled after Perl example).*/
|
||||
$string = "I am a string"
|
||||
say 'The string is:' $string
|
||||
x = "string"
|
||||
if right($string,length(x))=x then say 'It ends with:' x
|
||||
|
||||
y = "You"
|
||||
if left($string,length(y))\=y then say 'It does not start with:' y
|
||||
|
||||
z = "ring"
|
||||
if pos(z,$string)\==0 then say 'It contains the string:' z
|
||||
|
||||
z = "ring"
|
||||
if wordpos(z,$string)==0 then say 'It does not contain the word:' z
|
||||
$string="I am a string"
|
||||
say 'The string is:' $string
|
||||
x="string" ; if right($string,length(x))=x then say 'It ends with:' x
|
||||
y="You" ; if left($string,length(y))\=y then say 'It does not start with:' y
|
||||
z="ring" ; if pos(z,$string)\==0 then say 'It contains the string:' z
|
||||
z="ring" ; if wordpos(z,$string)==0 then say 'It does not contain the word:' z
|
||||
/*stick a fork in it, we're done.*/
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
$string = "I am a string"
|
||||
old = " a "
|
||||
new = " another "
|
||||
say 'The original string is:' $string
|
||||
say 'old word is:' old
|
||||
say 'new word is:' new
|
||||
say 'The original string is:' $string
|
||||
say 'old word is:' old
|
||||
say 'new word is:' new
|
||||
$string = changestr(old,$string,new)
|
||||
say 'The changed string is:' $string
|
||||
say 'The changed string is:' $string
|
||||
/*stick a fork in it, we're done.*/
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ $string = "I am a string"
|
|||
old = " a "
|
||||
new = " another "
|
||||
say 'The original string is:' $string
|
||||
say 'old word is:' old
|
||||
say 'new word is:' new
|
||||
say 'old word is:' old
|
||||
say 'new word is:' new
|
||||
$string2 = changestr(old,$string,new)
|
||||
say 'The original string is:' $string
|
||||
say 'The changed string is:' $string2
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
old = " am "
|
||||
new = " was "
|
||||
say 'The original string is:' $string
|
||||
say 'old word is:' old
|
||||
say 'new word is:' new
|
||||
say 'old word is:' old
|
||||
say 'new word is:' new
|
||||
|
||||
if wordpos(old,$string)\==0 then
|
||||
if wordpos(old,$string)\==0 then
|
||||
do
|
||||
$string = changestr(old,$string,new)
|
||||
say 'I was able to find and replace ' old " with " new
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue