LoginSignup
2
1

More than 5 years have passed since last update.

ランダムな文字列を発生させる

Last updated at Posted at 2015-01-04

ランダムな文字列を発生させる

RanString <- function(strlength){
  seed <- c("A","B","C","D","E","F","G","H","I","J",
            "K","L","M","N","O","P","Q","R","S","T",
            "U","V","W","X","Y","Z")
  paste(seed[round(runif(strlength, 1, length(seed)))], collapse="")
}

RanString(1)
RanString(2)
RanString(10)
2
1
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1