{"_id":"577383e8dceb570e003a9310","version":{"_id":"5772bf39dceb570e003a9133","project":"5772bf39dceb570e003a9130","__v":8,"createdAt":"2016-06-28T18:17:29.483Z","releaseDate":"2016-06-28T18:17:29.483Z","categories":["5772bf39dceb570e003a9134","57735073da551f0e00be5ccd","57735088dceb570e003a92d4","577381a3d98d530e00a3205c","577381bfda551f0e00be5d22","577381ced98d530e00a3205d","57738437da551f0e00be5d2a","577389850a6d610e00dea231"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"1.0.0 beta","version_clean":"1.0.0","version":"1.0.0"},"user":"572d05a4d7ab450e00c7f705","__v":0,"category":{"_id":"577381ced98d530e00a3205d","__v":0,"project":"5772bf39dceb570e003a9130","version":"5772bf39dceb570e003a9133","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-06-29T08:07:42.911Z","from_sync":false,"order":0,"slug":"функции","title":"Функции"},"project":"5772bf39dceb570e003a9130","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-06-29T08:16:40.004Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":999,"body":"Замена первого вхождения, если такое есть, подстроки pattern в haystack на подстроку replacement.\nЗдесь и далее, pattern и replacement должны быть константами.\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"SELECT replaceOne(desc, 'pattern', 'replacement') FROM test\",\n      \"language\": \"sql\"\n    }\n  ]\n}\n[/block]","excerpt":"Функции поиска и замены в строках","slug":"replaceonehaystack-pattern-replacement","type":"fn","title":"replaceOne(haystack, pattern, replacement)"}

replaceOne(haystack, pattern, replacement)

Функции поиска и замены в строках

Замена первого вхождения, если такое есть, подстроки pattern в haystack на подстроку replacement. Здесь и далее, pattern и replacement должны быть константами. [block:code] { "codes": [ { "code": "SELECT replaceOne(desc, 'pattern', 'replacement') FROM test", "language": "sql" } ] } [/block]