Warning: session_start(): open(/var/lib/php/sessions/sess_8049m9g2lqjsp5ilp0c2grjrtl, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static TextEdit createTextEdit(S text, S newText) {
S a = text, b = newText;
int i = lCommonPrefix(a, b);
if (i == l(a) && i == l(b)) null; // Strings are equal
a = substring(a, i);
b = substring(b, i);
int j = lCommonSuffix(a, b);
a = substring(a, 0, l(a)-j);
b = substring(b, 0, l(b)-j);
// Now differing part remains in a and b;
// i and j give length of unchanged beginning+end
if (empty(a) && empty(b)) null;
TextEdit edit = nuWithParams(TextEdit,
startIndex := i, endIndex := i+l(a), text := b);
// Verify!
assertEquals(newText, replayTextEdit(edit, text));
ret edit;
}