Quantcast
Viewing all articles
Browse latest Browse all 186

Randomly reversing a substring

I was thinking about how to make this with the StringReverse, but I failed:

I have a sequence of (for example):

str = "FDSRTYNHFNKHLIUHG";

I wish to reverse a randomly long contiguous sequence of characters starting at a random location, for example FDSRTYNHFNKHLIHUG (UH-HU), but it can also be FDSFHNYTRNKHLIUHG (RTYNHF-FHNYTR). Do you have some good ideas? Thank you!!!


Viewing all articles
Browse latest Browse all 186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>