2023-07-01 11:58:00 -04:00
|
|
|
fn main() {
|
|
|
|
|
str := 'abcd'
|
|
|
|
|
println(str.starts_with('ab')) // True
|
|
|
|
|
println(str.ends_with('zn')) // False
|
|
|
|
|
println(str.contains('bb')) // False
|
|
|
|
|
println(str.contains('ab')) // True
|
2024-10-16 18:07:41 -07:00
|
|
|
println(str.index('bc') or {-1}) // 1 // V arrays are 0 based; first char position is 0
|
2023-07-01 11:58:00 -04:00
|
|
|
}
|