Quantcast
Channel: Active questions tagged string-manipulation - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 189

Randomly reversing a substring

$
0
0

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 189

Latest Images

Trending Articles



Latest Images

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