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
[Term Entry] Dart Type Conversion .tryParse() #4572 #4586
Conversation
Hey @lou-pastorino! Please update the path to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @lou-pastorino!
Thanks for contributing to the Codecademy docs!
I've suggested a few changes, please review and modify them at your earliest convenience.
Thank you!
content/dart/concepts/type-conversion/terms/tryParse/tryParse.md
Outdated
Show resolved
Hide resolved
content/dart/concepts/type-conversion/terms/tryParse/tryParse.md
Outdated
Show resolved
Hide resolved
content/dart/concepts/type-conversion/terms/tryParse/tryParse.md
Outdated
Show resolved
Hide resolved
content/dart/concepts/type-conversion/terms/tryParse/tryParse.md
Outdated
Show resolved
Hide resolved
content/dart/concepts/type-conversion/terms/tryParse/tryParse.md
Outdated
Show resolved
Hide resolved
content/dart/concepts/type-conversion/terms/tryParse/tryParse.md
Outdated
Show resolved
Hide resolved
## Example | ||
|
||
1. value = num.tryParse('5'); // 5 | ||
2. value = num.tryParse('five'); // null | ||
|
||
|
||
## Codebyte Example (if applicable) | ||
|
||
```dart | ||
void main() { | ||
String input = '42'; | ||
int? parsedInt = int.tryParse(input); | ||
|
||
if (parsedInt != null) { | ||
print('Parsed integer: $parsedInt'); | ||
} else { | ||
print('Failed to parse the string as an integer'); | ||
} | ||
} | ||
``` | ||
The above code will return the following output: | ||
|
||
```dart | ||
//Parsed integer: 42 | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ## Codebyte is not needed, please place this codebyte under ## Example along with its output. Remove the:
value = num.tryParse('5'); // 5
2. value = num.tryParse('five'); // null
and ## Codebyte example tag
content/dart/concepts/type-conversion/terms/tryParse/tryParse.md
Outdated
Show resolved
Hide resolved
Co-authored-by: mamtawardhani <53176352+mamtawardhani@users.noreply.github.com>
Co-authored-by: mamtawardhani <53176352+mamtawardhani@users.noreply.github.com>
Co-authored-by: mamtawardhani <53176352+mamtawardhani@users.noreply.github.com>
Co-authored-by: mamtawardhani <53176352+mamtawardhani@users.noreply.github.com>
Co-authored-by: mamtawardhani <53176352+mamtawardhani@users.noreply.github.com>
Co-authored-by: mamtawardhani <53176352+mamtawardhani@users.noreply.github.com>
Co-authored-by: mamtawardhani <53176352+mamtawardhani@users.noreply.github.com>
@mamtawardhani hello! Thank you for your feedback. Pending your review, I believe I the suggested changes were made successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @lou-pastorino!
Can you please implement the one suggestion given? Thanks!
content/dart/concepts/type-conversion/terms/tryParse/tryParse.md
Outdated
Show resolved
Hide resolved
Co-authored-by: mamtawardhani <53176352+mamtawardhani@users.noreply.github.com>
@mamtawardhani Hey! The final suggestion has been implemented. |
Hey @lou-pastorino! Thank you for implementing the suggestions! Lastly, could you please update the path to |
Apologies, I must be getting confused somewhere. On my side it looks like the file path is as you have described above. Do I need to create a new pull request to merge the updated branch with my main branch to update the file path? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go for the second review.
@lou-pastorino Thanks for making the changes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
👋 @lou-pastorino 🎉 Your contribution(s) can be seen here: https://www.codecademy.com/resources/docs/dart/type-conversion/tryParse Please note it may take a little while for changes to become visible. |
Description
Issue Solved
Type of Change
Checklist
main
branch.Issues Solved
section.