Scalar functions
string
Commentary
added in 0.0.5
Generates strings which may be templated with #{}
, containing the names of local identifiers 1, variables 2, or Java Datafaker expressions 3 (Datafaker version 2.4.1
). Local identifiers will be resolved first, then vars, then Faker expressions.
Datafaker functions that take parameters must be invoked with single quotes and no spaces, as in #{Date.birthday '2','4'}
. 4
You may occasionally want to change the shape of the strings Datafaker generates. The string
function supports a handful of transforms. 5
By default, strings are generated with a locale configured for United States English, but you can override this. 6
Faker expressions and values
Use any of these expressions in the form of #{expr}
. Where applicable, links are supplied to the literal value list within the Datafaker project.
- Address.buildingNumber †
- Address.city †
- Address.cityName †
- Address.cityPrefix †
- Address.citySuffix †
- Address.country †
- Address.countryCode †
- Address.fullAddress †
- Address.latLon †
- Address.latitude †
- Address.lonLat †
- Address.longitude †
- Address.mailBox †
- Address.postcode †
- Address.secondaryAddress †
- Address.state †
- Address.stateAbbr †
- Address.streetAddress †
- Address.streetAddressNumber †
- Address.streetName †
- Address.streetPrefix †
- Address.streetSuffix †
- Address.timeZone †
- Address.zipCode †
- Address.zipCodePlus4 †
- Ancient.god †
- Ancient.hero †
- Ancient.primordial †
- Ancient.titan †
- Animal.genus †
- Animal.name †
- Animal.scientificName †
- Animal.species †
- App.author †
- App.name †
- App.version †
- Appliance.brand †
- Appliance.equipment †
- AquaTeenHungerForce.character †
- Artist.name †
- Australia.animals †
- Australia.locations †
- Australia.states †
- Avatar.image
- Aviation.METAR †
- Aviation.aircraft †
- Aviation.airline †
- Aviation.airplane †
- Aviation.airport †
- Aviation.airportName †
- Aviation.armyHelicopter †
- Aviation.cargo †
- Aviation.civilHelicopter †
- Aviation.engineType †
- Aviation.flight †
- Aviation.flightStatus †
- Aviation.gate †
- Aviation.general †
- Aviation.manufacturer †
- Aviation.specialTypeDesignator †
- Aviation.warplane †
- Aws.accountId †
- Aws.acmARN †
- Aws.albARN †
- Aws.albTargetGroupARN †
- Aws.region †
- Aws.route53ZoneId †
- Aws.securityGroupId †
- Aws.service †
- Aws.subnetId †
- Aws.vpcId †
- Azure.appServiceEnvironment †
- Azure.appServicePlan †
- Azure.applicationGateway †
- Azure.bastionHost †
- Azure.containerApps †
- Azure.containerAppsEnvironment †
- Azure.containerInstance †
- Azure.containerRegistry †
- Azure.cosmosDBDatabase †
- Azure.firewall †
- Azure.keyVault †
- Azure.loadBalancer †
- Azure.loadTesting †
- Azure.logAnalytics †
- Azure.managementGroup †
- Azure.mysqlDatabase †
- Azure.networkSecurityGroup †
- Azure.postgreSQLDatabase †
- Azure.region †
- Azure.resourceGroup †
- Azure.serviceBus †
- Azure.serviceBusQueue †
- Azure.serviceBusTopic †
- Azure.springApps †
- Azure.sqlDatabase †
- Azure.staticWebApp †
- Azure.storageAccount †
- Azure.subscriptionId †
- Azure.tenantId †
- Azure.virtualMachine †
- Azure.virtualNetwork †
- Azure.virtualWan †
- Babylon5.character †
- Babylon5.quote †
- BackToTheFuture.character †
- BackToTheFuture.date †
- BackToTheFuture.quote †
- Barcode.ean13 †
- Barcode.ean8 †
- Barcode.gtin12 †
- Barcode.gtin13 †
- Barcode.gtin14 †
- Barcode.gtin8 †
- Barcode.type †
- Baseball.coaches †
- Baseball.players †
- Baseball.positions †
- Baseball.teams †
- Basketball.coaches †
- Basketball.players †
- Basketball.positions †
- Basketball.teams †
- Battlefield1.classes †
- Battlefield1.faction †
- Battlefield1.map †
- Battlefield1.vehicle †
- Battlefield1.weapon †
- Beer.brand †
- Beer.hop †
- Beer.malt †
- Beer.name †
- Beer.style †
- Beer.yeast †
- BigBangTheory.character †
- BigBangTheory.quote †
- BloodType.aboTypes †
- BloodType.bloodGroup †
- BloodType.pTypes †
- BloodType.rhTypes †
- Boardgame.artist †
- Boardgame.category †
- Boardgame.designer †
- Boardgame.mechanic †
- Boardgame.name †
- Boardgame.publisher †
- Boardgame.subdomain †
- BojackHorseman.characters †
- BojackHorseman.quotes †
- BojackHorseman.tongueTwisters †
- Book.author †
- Book.genre †
- Book.publisher †
- Book.title †
- Bool.bool
- BossaNova.artist †
- BossaNova.song †
- Brand.car †
- Brand.sport †
- Brand.watch †
- BreakingBad.character †
- BreakingBad.episode †
- BrooklynNineNine.characters †
- BrooklynNineNine.quotes †
- Buffy.bigBads †
- Buffy.celebrities †
- Buffy.characters †
- Buffy.episodes †
- Buffy.quotes †
- Business.creditCardExpiry †
- Business.creditCardNumber †
- Business.creditCardType †
- Business.securityCode †
- CNPJ.invalid
- CNPJ.valid
- CPF.invalid
- CPF.valid
- Camera.brand †
- Camera.brandWithModel †
- Camera.model †
- Cannabis.brands †
- Cannabis.buzzwords †
- Cannabis.cannabinoidAbbreviations †
- Cannabis.cannabinoids †
- Cannabis.categories †
- Cannabis.healthBenefits †
- Cannabis.medicalUses †
- Cannabis.strains †
- Cannabis.terpenes †
- Cannabis.types †
- CareProvider.hospitalName †
- CareProvider.medicalProfession †
- Cat.breed †
- Cat.name †
- Cat.registry †
- Chess.opening †
- Chess.player †
- Chess.title †
- Chess.tournament †
- Chiquito.expressions †
- Chiquito.jokes †
- Chiquito.sentences †
- Chiquito.terms †
- ChuckNorris.fact †
- ClashOfClans.defensiveBuilding †
- ClashOfClans.rank †
- ClashOfClans.troop †
- Code.asin †
- Code.ean13 †
- Code.ean8 †
- Code.gtin13 †
- Code.gtin8 †
- Code.imei †
- Code.isbn10 †
- Code.isbn13 †
- Code.isbnGroup †
- Code.isbnGs1 †
- Code.isbnRegistrant †
- Coffee.blendName †
- Coffee.body †
- Coffee.country †
- Coffee.descriptor †
- Coffee.intensifier †
- Coffee.name1 †
- Coffee.name2 †
- Coffee.notes †
- Coffee.region †
- Coffee.variety †
- Coin.flip †
- Color.hex †
- Color.name †
- Commerce.brand †
- Commerce.department †
- Commerce.material †
- Commerce.price †
- Commerce.productName †
- Commerce.promotionCode †
- Commerce.vendor †
- Community.character †
- Community.quote †
- Company.bs †
- Company.buzzword †
- Company.catchPhrase †
- Company.industry †
- Company.logo †
- Company.name †
- Company.profession †
- Company.suffix †
- Company.url †
- Compass.abbreviation †
- Compass.azimuth †
- Compass.word †
- Computer.brand †
- Computer.linux †
- Computer.macos †
- Computer.operatingSystem †
- Computer.platform †
- Computer.type †
- Computer.windows †
- Construction.heavyEquipment †
- Construction.materials †
- Construction.roles †
- Construction.standardCostCodes †
- Construction.subcontractCategories †
- Construction.trades †
- Control.alteredItem †
- Control.alteredWorldEvent †
- Control.character †
- Control.hiss †
- Control.location †
- Control.objectOfPower †
- Control.quote †
- Control.theBoard †
- Cosmere.allomancers †
- Cosmere.aons †
- Cosmere.feruchemists †
- Cosmere.heralds †
- Cosmere.knightsRadiant †
- Cosmere.metals †
- Cosmere.shardWorlds †
- Cosmere.shards †
- Cosmere.sprens †
- Cosmere.surges †
- Country.capital †
- Country.countryCode2 †
- Country.countryCode3 †
- Country.currency †
- Country.currencyCode †
- Country.flag †
- Country.name †
- CowboyBebop.character †
- CowboyBebop.episode †
- CowboyBebop.quote †
- CowboyBebop.song †
- Cricket.formats †
- Cricket.players †
- Cricket.teams †
- Cricket.tournaments †
- CryptoCoin.coin †
- CultureSeries.books †
- CultureSeries.civs †
- CultureSeries.cultureShipClassAbvs †
- CultureSeries.cultureShipClasses †
- CultureSeries.cultureShips †
- CultureSeries.planets †
- Currency.code †
- Currency.name †
- DarkSouls.classes †
- DarkSouls.covenants †
- DarkSouls.shield †
- DarkSouls.stats †
- Date.birthday
- Date.birthdayLocalDate
- DcComics.hero †
- DcComics.heroine †
- DcComics.name †
- DcComics.title †
- DcComics.villain †
- Demographic.demonym †
- Demographic.educationalAttainment †
- Demographic.maritalStatus †
- Demographic.race †
- Demographic.sex †
- Departed.actor †
- Departed.character †
- Departed.quote †
- Dessert.flavor †
- Dessert.topping †
- Dessert.variety †
- DetectiveConan.characters †
- DetectiveConan.gadgets †
- DetectiveConan.vehicles †
- Device.manufacturer †
- Device.modelName †
- Device.platform †
- Device.serial †
- Disease.anyDisease †
- Disease.dermatology