There is no simple answer, and it also depends on the country/jurisdiction. The number of characters is not a primary criterion. Infringement requires that the original is already protected by copyright. According to US law an original work is one that is independently created, and not striking uniqueness, ingenuity, or novelty. It's even legal that substantially similar works exist as long as they were independently created. So a claimant must prove not only similarity, but also that the defendant actually copied the work (which might be an issue in the present case). And copyright doesn't protect functionality nor ideas, but the developer's "expression" of such functionality or ideas. And there are restrictions, e.g. that if there is only one or a limited number of ways to express a given functionality (regardless how many characters are used), the result will not be protected by copyright to avoid monopolies. And even if copyright applies, it could still be fair use.