def replaceStringBlocks(str, startId, endId, newContent):
    """ Replaces all string sections in blocks given by startId and endId tags by newContent.

    :param str str: Text content to be updated.
    :param str startId: Start identifier of the block to be replaced.
    :param str endId: End identifier of the block to be replaced.
    :param str newContent: New text content.
    :return: Updated str block.
    :rtype: str


    >>> replaceStringBlocks("Text pred.<ReplaceStart>StaryText<ReplaceEnd>Text za.", "<ReplaceStart>", "<ReplaceEnd>", "Next content.")
    'Text pred.Next content.Text za.'

    """
    endPos = 0
    while True:
        startPos = str.find(startId, endPos)
        endPos = str.find(endId, startPos)
        if startPos<0 or endPos<startPos:
            break

        str = str[:startPos] + newContent + str[endPos + len(endId):]

    return str