Used to easily create distinct labels when copying objects. The method has the following styles:
- default: "Label" becomes "Label (2)"
- dash: "Label" becomes "Label-2"
public function testInc() { isSame('title (2)', Str::inc('title', null, 0)); isSame('title(3)', Str::inc('title(2)', null, 0)); isSame('title-2', Str::inc('title', 'dash', 0)); isSame('title-3', Str::inc('title-2', 'dash', 0)); isSame('title (4)', Str::inc('title', null, 4)); isSame('title (2)', Str::inc('title', 'foo', 0)); }