Will the effort required to learn a completely new subject from scratch be outweighed by the better job prospects when one is looking for faculty positions?
Will your degree actually say 'String Theory' rather than 'Physics'? If so, this is unfortunately narrow, and given the uncertain future of string theory as a field I'd rectify it as soon as possible. How close are you to finishing? I wouldn't dump a Physics doctorate a year from completion to start over in CS. If I wanted to change fields, I'd just do a master's afterwards.