Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace String.toCharArray with String.charAt #1670

Open
yeikel opened this issue Apr 16, 2022 · 0 comments
Open

replace String.toCharArray with String.charAt #1670

yeikel opened this issue Apr 16, 2022 · 0 comments
Labels
recipe Requested Recipe uses-dataflow

Comments

@yeikel
Copy link
Contributor

yeikel commented Apr 16, 2022

final String helloWorld = "Hello world";
char[] chars = helloWorld.toCharArray(); // creates a copy using `System.arraycopy`

for (char c : chars) {
System.out.println(c);
}
final String helloWorld = "Hello world";

// iterates over the array backing the String

for (int i = 0 ; i < helloWorld.length();i++){
 System.out.println(helloWorld.charAt(i));
}
@tkvangorder tkvangorder moved this to Request for help in OpenRewrite Apr 18, 2022
@tkvangorder tkvangorder moved this from Request for help to Future in OpenRewrite Apr 18, 2022
@tkvangorder tkvangorder added recipe Requested Recipe and removed help wanted labels Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
recipe Requested Recipe uses-dataflow
Projects
Status: Recipes Wanted
Development

No branches or pull requests

2 participants