Skip to content

Commit 60b1bbf

Browse files
committed
first commit
0 parents  commit 60b1bbf

10 files changed

+421
-0
lines changed

Diff for: .gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Files and directories created by pub.
2+
.dart_tool/
3+
.packages
4+
5+
# Conventional directory for build output.
6+
build/

Diff for: .vscode/launch.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Dart & Flutter",
9+
"request": "launch",
10+
"type": "dart",
11+
"program": "lib/dart_string_extension.dart"
12+
}
13+
]
14+
}

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 1.0.0
2+
3+
- Initial version.

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A sample command-line application with an entrypoint in `bin/`, library code
2+
in `lib/`, and example unit test in `test/`.

Diff for: analysis_options.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file configures the static analysis results for your project (errors,
2+
# warnings, and lints).
3+
#
4+
# This enables the 'recommended' set of lints from `package:lints`.
5+
# This set helps identify many issues that may lead to problems when running
6+
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
7+
# style and format.
8+
#
9+
# If you want a smaller set of lints you can change this to specify
10+
# 'package:lints/core.yaml'. These are just the most critical lints
11+
# (the recommended set includes the core lints).
12+
# The core lints are also what is used by pub.dev for scoring packages.
13+
14+
include: package:lints/recommended.yaml
15+
16+
# Uncomment the following section to specify additional rules.
17+
18+
# linter:
19+
# rules:
20+
# - camel_case_types
21+
22+
# analyzer:
23+
# exclude:
24+
# - path/to/excluded/files/**
25+
26+
# For more information about the core and recommended set of lints, see
27+
# https://dart.dev/go/core-lints
28+
29+
# For additional information about configuring this file, see
30+
# https://dart.dev/guides/language/analysis-options

Diff for: bin/dart_string_extension.dart

Whitespace-only changes.

Diff for: lib/dart_string_extension.dart

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
void main() {
2+
String helloWorld = '';
3+
helloWorld = 'hello world And my neighbours'.toSentenceCase;
4+
print(helloWorld);
5+
helloWorld = 'Hello world and My neighbours'.allToCapital;
6+
print(helloWorld);
7+
helloWorld = 'Hello world and my Neighbours'.toTitleCase;
8+
print(helloWorld);
9+
}
10+
11+
extension StringCasesExtension on String {
12+
String get toSentenceCase =>
13+
'${this[0].toUpperCase()}${substring(1).toLowerCase()}';
14+
String get allToCapital => toUpperCase();
15+
String get toTitleCase =>
16+
split(" ").map((str) => str.toSentenceCase).join(" ");
17+
}

0 commit comments

Comments
 (0)