RichText/Archived/Rooster/Rooster.gcomp/Support/node_modules/roosterjs/dist/rooster-amd.js
/**
 * Split a text node into two parts by an offset number, and return one of them
 * @param textNode The text node to split
 * @param offset The offset number to split at
 * @param returnFirstPart True to return the first part, then the passed in textNode will become the second part.
 * Otherwise return the second part, and the passed in textNode will become the first part
 */
Split a text node into two parts by an offset number, and return one of them
@param textNode The text node to split
@param offset The offset number to split at
@param returnFirstPart True to return the first part, then the passed in textNode will become the second part.
Otherwise return the second part, and the passed in textNode will become the first part
Split a text node into two parts by an offset number and return one of them @param textNode The text node to split @param offset The offset number to split at @param returnFirstPart True to return the first part then the passed in textNode will become the second part . Otherwise return the second part and the passed in textNode will become the first part
function splitTextNode(textNode, offset, returnFirstPart) {
    var firstPart = textNode.nodeValue.substr(0, offset);
    var secondPart = textNode.nodeValue.substr(offset);
    var newNode = textNode.ownerDocument.createTextNode(returnFirstPart ? firstPart : secondPart);
    textNode.nodeValue = returnFirstPart ? secondPart : firstPart;
    textNode.parentNode.insertBefore(newNode, returnFirstPart ? textNode : textNode.nextSibling);
    return newNode;
}
function splitTextNode ( textNode , offset , returnFirstPart ) { var firstPart = textNode . nodeValue . substr ( 0 , offset ) ; var secondPart = textNode . nodeValue . substr ( offset ) ; var newNode = textNode . ownerDocument . createTextNode ( returnFirstPart ? firstPart : secondPart ) ; textNode . nodeValue = returnFirstPart ? secondPart : firstPart ; textNode . parentNode . insertBefore ( newNode , returnFirstPart ? textNode : textNode . nextSibling ) ; return newNode ; }
Split a text node into two parts by an offset number, and return one of them
 @param textNode The text node to split
 @param offset The offset number to split at
 @param returnFirstPart True to return the first part, then the passed in textNode will become the second part.
Split a text node into two parts by an offset number and return one of them @param textNode The text node to split @param offset The offset number to split at @param returnFirstPart True to return the first part then the passed in textNode will become the second part .