string_extensions.dart 863 B

123456789101112131415161718192021222324252627282930
  1. /// string_extensions.dart
  2. ///
  3. /// Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
  4. ///
  5. /// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  6. /// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  7. /// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  8. /// This notice may not be removed from this file.
  9. import 'package:flutter/foundation.dart';
  10. extension StringExtension on String {
  11. String capitalize() {
  12. if (isEmpty) {
  13. return this;
  14. } else {
  15. return this[0].toUpperCase() + substring(1);
  16. }
  17. }
  18. }
  19. void conversionLog(String msg){
  20. if (kDebugMode) {
  21. StringBuffer sb = StringBuffer();
  22. sb.write("CPDFConversion");
  23. sb.write(" : ");
  24. sb.write(msg);
  25. print(sb.toString());
  26. }
  27. }