File: string.md

package info (click to toggle)
ruby-faker 2.21.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,076 kB
  • sloc: ruby: 19,088; makefile: 6
file content (11 lines) | stat: -rw-r--r-- 582 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
# Faker::String
Random UTF-8 string with optional nested length selectors.  Very useful for testing.  Guaranteed to find bugs in your code.  Want robust code?  Test with these.  Includes every UTF-8 codepoint.

```ruby
# Keyword arguments: length
Faker::String.random #=> "3 뇦\u0017&y\u{3A109}$8^4* 녹豿4좘툢ꔾ쉙6ɉ\uA6 8TN畀챵|\"3쇤Ŵ"
Faker::String.random(length: 4) #=> "⼨%0*"
Faker::String.random(length: 3..12) #=> "\u{69FDC};秨툫"
Faker::String.random(length: [0, 6]) #=> "I轤𣴒P溟L"
Faker::String.random(length: [1, (2..5), [3, 6], nil]) #=> "葓L#ћ"
```