Skip to content

Commit 5d1f9ee

Browse files
authored
Merge pull request #247 from baeolophus/shark_changes
Change string substitution example
2 parents b974356 + 1c14dc1 commit 5d1f9ee

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

_episodes/05-loops.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -495,16 +495,16 @@ NEWSTR = replace(STR, OLD, NEW)
495495
{: .language-matlab}
496496
497497
So for example if we have the string `big_shark` and want to get the string
498-
`terror_shark`, we can execute the following command:
498+
`little_shark`, we can execute the following command:
499499
500500
```
501-
>> new_string = replace('big_shark', 'big', 'terror');
501+
>> new_string = replace('big_shark', 'big', 'little');
502502
>> disp(new_string)
503503
```
504504
{: .language-matlab}
505505
506506
```
507-
terror_shark
507+
little_shark
508508
```
509509
{: .output}
510510
@@ -515,8 +515,8 @@ terror_shark
515515
> but the `strrep` function is a direct replacement.
516516
> The above example becomes
517517
> ```
518-
> >> new_string = strep('big_shark', 'big', 'terror')
519-
> terror_shark
518+
> >> new_string = strep('big_shark', 'big', 'little')
519+
> little_shark
520520
> ```
521521
> {: .language-matlab}
522522
{: .callout}

0 commit comments

Comments
 (0)