Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
15
Task/String-matching/PureBasic/string-matching-1.basic
Normal file
15
Task/String-matching/PureBasic/string-matching-1.basic
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Procedure StartsWith(String1$, String2$)
|
||||
Protected Result
|
||||
If FindString(String1$, String2$, 1) =1 ; E.g Found in possition 1
|
||||
Result =CountString(String1$, String2$)
|
||||
EndIf
|
||||
ProcedureReturn Result
|
||||
EndProcedure
|
||||
|
||||
Procedure EndsWith(String1$, String2$)
|
||||
Protected Result, dl=Len(String1$)-Len(String2$)
|
||||
If dl>=0 And Right(String1$, Len(String2$))=String2$
|
||||
Result =CountString(String1$, String2$)
|
||||
EndIf
|
||||
ProcedureReturn Result
|
||||
EndProcedure
|
||||
Loading…
Add table
Add a link
Reference in a new issue