Module | Random::StringExtensions
In: | lib/standard/facets/random.rb

### Methods

at_rand at_rand! included rand_byte rand_byte! rand_index shuffle shuffle!

### Classes and Modules

Module Random::StringExtensions::Self

### Public Class methods

included(base)

### Public Instance methods

at_rand( separator=// )

Return a random separation of the string. Default separation is by charaacter.

      "Ruby rules".at_rand(' ')  #~> ["Ruby"]

at_rand!( separator=// )

Return a random separation while removing it from the string. Default separation is by character.

      s = "Ruby rules"
      s.at_rand!(' ')    #~> "Ruby"
      s                  #~> "rules"

rand_byte()

Return a random byte of self.

      "Ruby rules".rand_byte  #~> 121

rand_byte!()

Destructive rand_byte. Delete a random byte of self and return it.

      s = "Ruby rules"
      s.rand_byte!      #~> 121
      s                 #~> "Rub rules"

rand_index()

Return a random string index.

      "Ruby rules".rand_index  #~> 3

shuffle(separator=//)

Return the string with seperated sections arranged in a random order. The default seperation is by character.

      "Ruby rules".shuffle  #~> "e lybRsuur"

shuffle!(separator=//)

In place version of shuffle.

[Validate]