From 20d066a6596a6c5e73529d6047dd252ce1c1c80b Mon Sep 17 00:00:00 2001 From: zhaolei Date: Thu, 25 Mar 2021 22:42:43 +0800 Subject: [PATCH] fix charAt dart substring /// The substring of this string from [start],inclusive, to [end], exclusive. /// /// Example: /// ```dart /// var string = 'dartlang'; /// string.substring(1); // 'artlang' /// string.substring(1, 4); // 'art' /// ``` String substring(int start, [int? end]); --- lib/src/js.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/js.dart b/lib/src/js.dart index 8967b33..a1d78d1 100644 --- a/lib/src/js.dart +++ b/lib/src/js.dart @@ -119,7 +119,7 @@ dynamic reduceRight(List list, /// Strings -String charAt(String str, int atPos) => str.substring(atPos, 1); +String charAt(String str, int atPos) => str.substring(atPos, atPos+1); int charCodeAt(String str, int atPos) => str.codeUnitAt(atPos);