-
Notifications
You must be signed in to change notification settings - Fork 86
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
Feature/strings #147
Feature/strings #147
Conversation
Hi, I have removed the console functions :) |
README.md
Outdated
|
||
```dart | ||
const text = 'welcome to my 2nd world'; | ||
print(text.title()); // Welcome To My 2nd World |
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.
That seems to be a good addition to the recase
package
README.md
Outdated
|
||
```dart | ||
print('http://www.example.com'.isHttp); // true | ||
print('htt://www//'.isHttp); // false |
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.
Not seeing the value tbh
```dart | ||
const originalUrl = 'Hello Ladies + Gentlemen, a signed OAuth request!'; | ||
final encodedUrl = originalUrl.urlEncode; | ||
// 'Hello%20Ladies%20+%20Gentlemen,%20a%20signed%20OAuth%20request!' |
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.
fantastic!
|
||
```dart | ||
print('as'.matches(RegExp('^.s\$'))) // true | ||
print('mst'.matches(RegExp('^.s\$'))) // false |
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.
Love it
README.md
Outdated
|
||
```dart | ||
const text = 'I love apples, apple are my favorite fruit'; | ||
print(text.count('apple', 0, 20)) // 2 |
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.
Too mixed. I'd split setting the range and counting.
Also, I could image count()
to do many other things. Not a good name for this
README.md
Outdated
```dart | ||
const text = 'I could eat bananas all day'; | ||
print(text.partition('bananas') // ['I could eat ', 'bananas', ' all day'] | ||
print(text.partition('apple') // ['I could eat bananas all day', '', ''] |
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.
instead of a String
, we could inject a bool Function(index)
to make it more general?
README.md
Outdated
const text = 'banana'; | ||
print(text.center(2, '*')); // **banana** | ||
print(text.leftJust(2, '*')); // **banana | ||
print(text.rightJust(2, '*')); // banana** |
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.
Not sure how it is different from padLeft
/padRight
Converts this value to character | ||
|
||
```dart | ||
final character = 97.toChar(); // a |
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.
👍
# Conflicts: # README.md # lib/src/string.dart # test/string_test.dart
Codecov Report
@@ Coverage Diff @@
## master #147 +/- ##
==========================================
+ Coverage 97.81% 97.83% +0.02%
==========================================
Files 13 13
Lines 777 787 +10
==========================================
+ Hits 760 770 +10
Misses 17 17
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
For those, that did not make it immediately in, create new PRs :) |
Add string function