Been playing around with Random_Shuffle again and trying to figure out a way to add a single space into the string to shuffle it as a single character space that can end up in any element location as a result of the random_shuffle. The C++ instructions that I am working with are like the following. But there is no escape character sequence that I can find to add a single space to the string to be shuffled.
I found a reference to
isspace which could be used for a character substitution in place of space such as space detected pass a character as
ö for space in the input string that works with this shuffle below if
ö was added to the string to shuffle to pair up as a character match.
https://www.geeksforgeeks.org/isspace-in-c-and-its-application-to-count-whitespace-characters/string str="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklm nopqrstuvwxyz1234567890!@#$%^&*()_-+=?<>:\\/~.,;";
random_shuffle(str.begin(), str.end())
Wasn't sure if maybe an unusual to English character may need to be used such as
ö added to the list for substitution for space, and
ö is used for a space translation in the output, or if there is a method to add the ASCII equivalent to space character in the string above such as ASCII code 0x20. Been trying a few things and compiler not happy with trying to force it to accept a single space to the string str. I haven't gone through the method yet of adding an
ö to the string to be shuffled and perform a space to
ö translation yet because I have been known to do things the hard way and perhaps there is a better way than a character substitution, however if the character substitution method if the best way to get it to accept adding a space to the shuffle, then i can go that route.