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

offsetbycodepoints function added #1590 #2453

Merged
merged 14 commits into from
Jun 23, 2023

Conversation

sumitdethe27
Copy link
Contributor

Java Strings: .offsetByCodePoints() Method Added- Issue fixed #1590

Type of Change

  • Adding a new entry

Checklist

  • [ x] All writings are my own.
  • [x ] My entry follows the Codecademy Docs style guide.
  • [x ] My changes generate no new warnings.
  • [ x] I have performed a self-review of my own writing and code.
  • [ x] I have checked my entry and corrected any misspellings.
  • [ x] I have made corresponding changes to the documentation if needed.
  • [x ] I have confirmed my changes are not being pushed from my forked main branch.
  • [ x] I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • [ x] Under "Development" on the right, I have linked any issues that are relevant to this PR (write "Closes # in the "Description" above).

@CLAassistant
Copy link

CLAassistant commented Jun 10, 2023

CLA assistant check
All committers have signed the CLA.

@SSwiniarski SSwiniarski added java Java entries new entry New entry or entries status: under review Issue or PR is currently being reviewed labels Jun 10, 2023
@SSwiniarski SSwiniarski self-assigned this Jun 10, 2023
Copy link
Contributor

@SSwiniarski SSwiniarski left a comment

Choose a reason for hiding this comment

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

@sumitdethe27 I did a first review and left a few comments.

@sumitdethe27
Copy link
Contributor Author

@SSwiniarski I have made the changes, Please review.

Copy link
Contributor

@SSwiniarski SSwiniarski left a comment

Choose a reason for hiding this comment

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

@sumitdethe27 More comments.

```

- `startIndex` (int): The starting index in the string from which the offset is applied.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Remove extra line break.

Copy link
Contributor Author

@sumitdethe27 sumitdethe27 Jun 11, 2023

Choose a reason for hiding this comment

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

OKay

New Index: 7
```

## Example 2
Copy link
Contributor

Choose a reason for hiding this comment

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

You haven't addressed my issue with the duplicative examples:

The next two examples are essentially the same as the first one. It might be good to show an example of fetching a character from the middle of a string of completely non-Latin script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@SSwiniarski In Example 3, I have added a completely non-latin script.

Copy link
Contributor

@SSwiniarski SSwiniarski left a comment

Choose a reason for hiding this comment

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

@sumitdethe27 some more comments.


## Example 3

In this example, the string str contains the text `"Hello, 世界!".` We specify the starting index as 0 and the code point offset as 5. The `**offsetByCodePoints()**` method returns the new index after applying the offset, which is 5 in this case. It means that the character at index 5 is the desired character.
Copy link
Contributor

Choose a reason for hiding this comment

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

You haven't updated the description to match.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for catching that mistake. I apologize for the confusion caused by the incorrect description. I have now updated the code and description to reflect the correct behavior.

New Index: 7
```

## Example 2
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove example two, as it pretty much duplicates example one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

@sumitdethe27
Copy link
Contributor Author

@SSwiniarski please review the changes.

Copy link
Contributor

@SSwiniarski SSwiniarski left a comment

Choose a reason for hiding this comment

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

@sumitdethe27 I forwarding this off to a second review.

@sumitdethe27
Copy link
Contributor Author

@sumitdethe27 I forwarding this off to a second review.

Thankyou

Copy link
Contributor

@caupolicandiaz caupolicandiaz left a comment

Choose a reason for hiding this comment

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

@sumitdethe27 I've added several comments. Please update the entry, and tag me when you've finished making changes. Thanks

@sumitdethe27
Copy link
Contributor Author

@caupolicandiaz I have made the changes

Copy link
Contributor

@caupolicandiaz caupolicandiaz left a comment

Choose a reason for hiding this comment

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

@sumitdethe27 @SSwiniarski Looks good to merge

@SSwiniarski SSwiniarski merged commit d4a8619 into Codecademy:main Jun 23, 2023
@github-actions
Copy link

👋 @sumitdethe27
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out this four question survey to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!

@SSwiniarski
Copy link
Contributor

@sumitdethe27 Congrats on the new entry. Live link here: https://www.codecademy.com/resources/docs/java/strings/offsetByCodePoints

image

You're currently anonymous. If you don't wish to be anonymous, check out this forum thread on how to link your GitHub and Codecademy profiles: https://discuss.codecademy.com/t/my-contribution-is-live-but-im-not-being-shown-as-a-contributor-why-is-this/758036 Note: it may take a few minutes for the change to register on the entry page.

@sumitdethe27
Copy link
Contributor Author

Thankyou @SSwiniarski

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Term Entry] Java Strings: .offsetByCodePoints() Method
4 participants