# Printf with variable format string

**URL:** https://discourse.julialang.org/t/printf-with-variable-format-string/3805
**Category:** General Usage
**Tags:** strings, formatting, printf
**Created:** [May 19, 2017, 10:53am UTC](https://discourse.julialang.org/t/printf-with-variable-format-string/3805 "2017-05-19T10:53:39Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![fatteneder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fatteneder/32/33991_2.png) [@fatteneder](https://discourse.julialang.org/u/fatteneder)
#### Post date: [May 22, 2023, 5:54pm UTC](https://discourse.julialang.org/t/printf-with-variable-format-string/3805/12 "2023-05-22T17:54:24Z")

</div>

> [@Using a variable to format printf not allowed?](https://discourse.julialang.org/t/using-a-variable-to-format-printf-not-allowed/99200/7):
>
> Like @Barget said, try the ? operator: help?\> Printf.Format Printf.Format(format\_str) Create a C printf-compatible format object that can be used for formatting values. The input format\_str can include any valid format specifier character and modifiers. A Format object can be passed to Printf.format(f::Format, args...) to produce a formatted string, or Printf.format(io::IO, f::Format, args...) to print the formatted string directly to io. For convenience, the Printf.format"..…

---

_[View the full topic](https://discourse.julialang.org/t/printf-with-variable-format-string/3805)._
