Skip to content

Commit d2d7ea4

Browse files
authored
Create HasPrefix.fs
1 parent ace9119 commit d2d7ea4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Algorithms/Strings/HasPrefix.fs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module HasPrefix =
2+
/// <summary>
3+
/// Reports string has specified prefix or not.
4+
/// </summary>
5+
let HasPrefix (s: string, prefix: string): bool =
6+
s.Length >= prefix.Length && s.Substring(0, prefix.Length) = prefix
7+

0 commit comments

Comments
 (0)