Skip to content

ShaniTheCoder/FormatString

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FormatString

Use

consider:

string name = "Harry"
int age  = 21
profession = "developer"
std::cout<<name<<" is "<<age<<" Years old"<<profession;

Below is corresponding code for cout using format()

format("{0} us {1} years old {2}",name,age,profession);

Usage/Examples

clone this repository and import "format.h" that's now you just have to call format() function.

#include "format.h"
#include "iostream"

using namespace std;
int main() {
  format("Hello i am {0} I am {1} years old, this is an Example of How you can use {2} ",
             "ShaniTheCoder",18, "Format.h format function");
  return 0;
}

Output:

>>> Hello i am  ShaniTheCoder I am 18 years old, this is an Example of How you can use  Format.h format function

About

Build to provide the missing string formatting in c++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages