Skip to content

Commit

Permalink
#234 Updated sample and docs as has_prefix has been moved to seq.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericzhang6222 committed May 13, 2020
1 parent 6f21ca6 commit 509fc6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/std-str.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ Usage:
| `//str.title("laser noises pew pew pew")` | `"Laser Noises Pew Pew Pew"` |
| `//str.title("pew")` | `"Pew"` |

## `//str.has_prefix(s <: string, prefix <: string) <: bool`
## `//seq.has_prefix(s <: string, prefix <: string) <: bool`

`has_prefix` checks whether the string `s` is prefixed by `prefix`. It returns a boolean.

Usage:

| example | equals |
|:-|:-|
| `//str.has_prefix("I'm running out of stuff to write", "I'm")` | `true` |
| `//str.has_prefix("I'm running out of stuff to write", "to write")` | `{}` which is equal to `false` |
| `//seq.has_prefix("I'm running out of stuff to write", "I'm")` | `true` |
| `//seq.has_prefix("I'm running out of stuff to write", "to write")` | `{}` which is equal to `false` |

## `//str.has_suffix(s <: string, suffix <: string) <: bool`

Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/grpc-proto.arrai
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let grpc = //{./grpc};
let wrap = "wrap" <: app.attrs.patterns;
let proto = //{./proto-util}(wrap);
let endpoints = app.endpoints where !//str.has_prefix(.@item.name, "enum ");
let endpoints = app.endpoints where !//seq.has_prefix(.@item.name, "enum ");
//archive.tar.tar({
app.name + ".proto": $`
// THIS IS AUTOGENERATED BY sysl //
Expand Down

0 comments on commit 509fc6c

Please sign in to comment.