mirror of
https://github.com/lukaszraczylo/mcp-captcharesolver.git
synced 2026-10-12 00:45:28 +00:00
14 lines
289 B
Go
14 lines
289 B
Go
package captcha
|
|
|
|
import "strings"
|
|
|
|
// extractJSON returns the first {...} JSON object found in s, or s unchanged.
|
|
func extractJSON(s string) string {
|
|
start := strings.Index(s, "{")
|
|
end := strings.LastIndex(s, "}")
|
|
if start >= 0 && end > start {
|
|
return s[start : end+1]
|
|
}
|
|
return s
|
|
}
|