How do I use strstr in Swift to search for a string within a string? I'm not sure how to use UnsafePointer! in Swift. strstr takes two arguments of both that type and returns a value of that type. Is this C or C++? Can I use C or C++ code in Swift, or could I use strstr in Objective-C and use a bridging header?
When I use this code:
var str1 = "Hello"
var str2 = "ll"
var ptr = strstr(str1, str2)
print(ptr)
print(ptr?.pointee)
I get this result:
Optional(0x00006000039bd762)
Optional(0)