Open SasinduDilshara opened 2 years ago
This document contains the string reverse functionality of other Programming Languages. https://docs.google.com/document/d/1yQu1fjvhMFSMDr1UfoC-OXVtk_mrb4I9_2clpX4Z7kw/edit?usp=sharing
The solution with toBytes/fromBytes won't work for non-ASCII characters.
What is this useful for?
Does reversing characters really make sense with Unicode combining characters? For example, if I have the letter A followed combining circumflex accent, and then reverse it, I will get a combining circumflex accent followed A, which won't be displayable sensibly. Would reversing grapheme clusters make more sense?
This reverse
method will be helpful for algorithms that use palindromes
.
And also reverse
method will help to deal with some regular expressions
efficiently.
The solution with toBytes/fromBytes won't work for non-ASCII characters.
What is this useful for?
Does reversing characters really make sense with Unicode combining characters? For example, if I have the letter A followed combining circumflex accent, and then reverse it, I will get a combining circumflex accent followed A, which won't be displayable sensibly. Would reversing grapheme clusters make more sense?
+1 for adding functionality for reversing grapheme clusters.
Description: There is no in-built function to reverse a Ballerina String. There are few other methods available
But there is no in-built function to reverse a string.
Suggested Labels: