Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
20
Task/String-matching/AWK/string-matching.awk
Normal file
20
Task/String-matching/AWK/string-matching.awk
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/awk -f
|
||||
{
|
||||
if ($1 ~ "^"$2) {
|
||||
print $1" begins with "$2;
|
||||
} else {
|
||||
print $1" does not begin with "$2;
|
||||
}
|
||||
|
||||
if ($1 ~ $2) {
|
||||
print $1" contains "$2;
|
||||
} else {
|
||||
print $1" does not contain "$2;
|
||||
}
|
||||
|
||||
if ($1 ~ $2"$") {
|
||||
print $1" ends with "$2;
|
||||
} else {
|
||||
print $1" does not end with "$2;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue