class Str

Methods

string
replaceBetween(string $haystack, string $needle, Closure $replacementMethod)

Replace the $needle strings within the $haystack with whatever the $replacementMethod tells us. Replacement method will be given a $between variable

Details

at line 29
string replaceBetween(string $haystack, string $needle, Closure $replacementMethod)

Replace the $needle strings within the $haystack with whatever the $replacementMethod tells us. Replacement method will be given a $between variable

Usage:

replaceBetween('something @here(...) and @here(...)', '@here', function($between) { return "[ $between ]";" });

Returns

something [ ... ] and [ ... ]

This method is used by Devise\Pages\Docs\LiveSpan.

Parameters

string $haystack
string $needle
Closure $replacementMethod

Return Value

string