Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

[New rule] avoid-substring #1201

Closed
Closed
@fzyzcjy

Description

@fzyzcjy

Rule details

As we know, using String.substring method will cause problems if you are having emojis in the string. There are many articles in the web, such as dart-lang/sdk#35798. Users should replace s.substring(100,200) with s.characters.getRange(100,200).

What type of rule is this?

Warns about a potential problem

Example code

s.substring(100,200); // LINT


### Participation

- [ ] I am willing to submit a pull request to implement this rule.

### Additional comments

_No response_

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions