1

I did this:

var f = new Faker();
String.Join("", f.Random.Digits(10)

However, is there another method that would eliminate the 'Join' call?

b_levitt
  • 7,059
  • 2
  • 41
  • 56
  • What's with all the capitalized function names? – Adrian M. May 24 '20 at 20:10
  • .net framework guidelines indicate Pascal casing generally for all public members. https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/capitalization-conventions If you're used to javascript, it's javascript that's wrong, not the other way around :P. – b_levitt May 27 '20 at 07:31
  • I'm used to the majority of languages, which don't use Pascal-case; I used Free Pascal in school but only briefly. – Adrian M. May 27 '20 at 11:45

1 Answers1

5

Wow. Sorry for the late reply, but yes there's a way to do this in Bogus.

void Main()
{
   var f = new Faker();
   var numberString = f.Random.ReplaceNumbers("##########");
   numberString.Dump();
}

OUTPUT:

2166951396

By the way, thanks for using Bogus!

Brian Chavez
  • 8,048
  • 5
  • 54
  • 47