Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix trimming #11666

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

Closed
thomasleplus wants to merge 1 commit into arduino:master from thomasleplus:patch-1
Closed

Fix trimming #11666

thomasleplus wants to merge 1 commit into arduino:master from thomasleplus:patch-1

Conversation

Copy link

@thomasleplus thomasleplus commented Sep 18, 2021
edited
Loading

The trim() method returns a new trimmed string, it does not alter the current string (strings being immutable in Java).

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you lint your code locally prior to submission?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes

The trim() method returns a new trimmed string, it does not alter the current string (strings being immutable in Java).
Copy link

CLAassistant commented Sep 18, 2021
edited
Loading

CLA assistant check
All committers have signed the CLA.

for (String item : strArray) {
item.trim();
for (int i = 0; i < strArray.length; i++) {
strArray[i] = strArray[i].trim();
Copy link

@abimarank abimarank Nov 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Java 8 is supported, we can use like below

import java.util.Arrays;
Arrays.parallelSetAll(strArray, (i) -> strArray[i].trim());

Copy link
Author

@thomasleplus thomasleplus Nov 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Sadly I have deleted my fork so I can't modify this PR. I'll close it and submit a new one (#11710). Sorry for the inconvenience.

abimarank reacted with confused emoji
Copy link
Collaborator

per1234 commented Nov 30, 2021

Superseded by #11710

@per1234 per1234 added Component: IDE The Arduino IDE Type: Duplicate Another item already exists for this topic Type: Bug labels Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
1 more reviewer

@abimarank abimarank abimarank left review comments

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
Component: IDE The Arduino IDE Type: Bug Type: Duplicate Another item already exists for this topic
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /