dart capitalize first letter of each word
extension CapExtension on String {
String get inCaps => '${this[0].toUpperCase()}${this.substring(1)}';
String get allInCaps => this.toUpperCase();
String get capitalizeFirstofEach => this.split(" ").map((str) => str.capitalize).join(" ");
}
final helloWorld = 'hello world'.inCaps; // 'Hello world'
final helloWorld = 'hello world'.allInCaps; // 'HELLO WORLD'
final helloWorld = 'hello world'.capitalizeFirstofEach; // 'Hello World'
Also in Swift:
- store bool value in nsuserdefaults swift
- convert string to int swift
- Split a String into an array in Swift
- set image width and height swiftui
- give background color swiftui
- how to swift pie chart quartzcore framework
- swift dispatch after
- swift wait 5 seconds
- get item filter count swift
- Core Data Quickest way to delete all instances of an entity swift
- .next() enum swift
- swift uitextfield only numbers keyboard lock programmatically
- swift from 1 to 01
- swift uitableview insert cell
- swift ns_enum generic name
- swift ternary statement
- swift corner radious of view controller
- swift show title on navigation bar programmatically
- how to set the center in view in swift
- swiftui background color
- hide bottom tab bar swift
- Get the length of a String swift
- swift change enum value
- how to show notification icon on tabbar item swift