Replace text within a portion of a string