Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/String-matching/C-sharp/string-matching.cs
Normal file
13
Task/String-matching/C-sharp/string-matching.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class Program
|
||||
{
|
||||
public static void Main (string[] args)
|
||||
{
|
||||
var value = "abcd".StartsWith("ab");
|
||||
value = "abcd".EndsWith("zn"); //returns false
|
||||
value = "abab".Contains("bb"); //returns false
|
||||
value = "abab".Contains("ab"); //returns true
|
||||
int loc = "abab".IndexOf("bb"); //returns -1
|
||||
loc = "abab".IndexOf("ab"); //returns 0
|
||||
loc = "abab".IndexOf("ab",loc+1); //returns 2
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue