{0} is a placeholder for the first object given; in this case that's filename, so it will insert whatever filename evaluates to in place of {0}. Similarly, of course you could use {1} and that would be replaced with the second parameter passed, etc.

Answer from Alexander Corwin on Stack Overflow
🌐
Medium
medium.com › @erichdryn › format-string-0-picoctf-writeup-9e8af9e163ff
format string 0 — PicoCTF Writeup | by Eric H | Medium
August 26, 2024 - After doing some research on format strings and revisiting the source code, I discovered that the option "Gr4d_Cheese" is the only one that fulfills the specific conditions in the code.
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › standard › base-types › custom-numeric-format-strings
Custom numeric format strings - .NET | Microsoft Learn
Dim value As Double value = 123 Console.WriteLine(value.ToString("00000")) Console.WriteLine(String.Format("{0:00000}", value)) ' Displays 00123 value = 1.2 Console.WriteLine(value.ToString("0.00", CultureInfo.InvariantCulture)) Console.WriteLine(String.Format(CultureInfo.InvariantCulture, "{0:0.00}", value)) ' Displays 1.20 Console.WriteLine(value.ToString("00.00", CultureInfo.InvariantCulture)) Console.WriteLine(String.Format(CultureInfo.InvariantCulture, "{0:00.00}", value)) ' Displays 01.20 Dim daDK As CultureInfo = CultureInfo.CreateSpecificCulture("da-DK") Console.WriteLine(value.ToStrin
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › api › system.string.format
String.Format Method (System) | Microsoft Learn
' You are now 7 years old. ' You are now 9 years old. ' You are now 13 years old. ... Replaces the format items in a string with the string representations of corresponding objects in a specified span.
🌐
HackMD
hackmd.io › @coding-challenge › rkGwKhZG0
Format string 0 - HackMD
Patrick is happy!", "Now can you serve the second customer?", "Sponge Bob wants something outrageous that would break the shop", "(better be served quick before the shop owner kicks you out!)", "Please choose from the following burgers:", "Pe%to_Portobello, $outhwest_Burger, Cla%sic_Che%s%steak", "Enter your recommendation: "); fflush(stdout); char choice2[BUFSIZE]; scanf("%s", choice2); char *menu2[3] = {"Pe%to_Portobello", "$outhwest_Burger", "Cla%sic_Che%s%steak"}; if (!on_menu(choice2, menu2, 3)) { printf("%s", "There is no such burger yet!\n"); fflush(stdout); } else { printf(choice2); ff
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › standard › base-types › standard-numeric-format-strings
Standard numeric format strings - .NET | Microsoft Learn
The exponential ("E") format specifier converts a number to a string of the form "-d.ddd…E+ddd" or "-d.ddd…e+ddd", where each "d" indicates a digit (0-9). The string starts with a minus sign if the number is negative.
Find elsewhere
🌐
Rick Strahl's Web Log
weblog.west-wind.com › posts › 2021 › Jan › 05 › Blank-Zero-Values-in-NET-Number-Format-Strings
Blank Zero Values in .NET Number Format Strings - Rick Strahl's Weblog
January 5, 2021 - Unfortunately when you use the ; separator you can't use standard formatting strings like c or n2 or x etc. Instead you have to stick to 0 integer syntax or an explicit number format specified by ##.## replacements in the string.
🌐
TutorialsPoint
tutorialspoint.com › article › the-0-custom-format-specifier-in-chash
The "0" custom format specifier in C#
March 17, 2026 - Following is the syntax for using the "0" custom format specifier − · number.ToString("000") // For integers with leading zeros number.ToString("0.00") // For decimals with trailing zeros String.Format("{0:000}", number) // Using String.Format ...
🌐
UiPath Community
forum.uipath.com › help › activities
Meaning of {1:0.##} in string.format - Activities - UiPath Community Forum
April 11, 2021 - Hi there, I am doing Practice 4 of Data Manipulation in the RPA Developer Foundation course and I have a question regarding the string.format method. Say I have a dictionary called Cities which contains cities(string) as keys and weight(double) as values. I want to create an input dialogue that lets me choose from the cities and returns the weight accordingly.
🌐
OSINT Team
osintteam.blog › pico-ctf-format-string-0-binary-exploitation-category-0fe8084178e3
Pico CTF: “Format string 0" Binary Exploitation Category | by HusnaAnjum | OSINT Team
March 19, 2025 - This CTF challenge is about format string vulnerabilities, which occur when user-controlled input is used improperly in functions like printf, fprintf, or sprintf.
🌐
DZone
dzone.com › coding › languages › c# string format examples
C# String Format Examples - DZone
December 4, 2024 - In .NET 4.6, a new type called FormattableString was introduced. It includes the format string that would typically be passed to string.Format (e.g. "Hello, {0}"); and the arguments needed for formatting. Importantly, this information is captured before the string is formatted, allowing you to adjust the formatting as needed, most commonly to use the invariant culture with the Invariant static method.
🌐
C# Corner
c-sharpcorner.com › UploadFile › mahesh › format-string-in-C-Sharp
C# String Formatting Explained With Practical Examples
January 31, 2026 - For a single object formatting, the first argument is the format and the second argument is the value of the object. The object is replaced at the {0} position in the string.
🌐
GitHub
github.com › snwau › picoCTF-2024-Writeup › blob › main › Binary Exploitation › format string 0 › format string 0.md
picoCTF-2024-Writeup/Binary Exploitation/format string 0/format string 0.md at main · snwau/picoCTF-2024-Writeup
$ echo -e "Gr4d_Cheese" | ./format-string-0 Welcome to our newly-opened burger place Pico 'n Patty! Can you help the picky customers find their favorite burger? Here comes the first customer Patrick who wants a giant bite. Please choose from the following burgers: Breakf@st_Burger, Gr4d_Cheese, Bac0n_D3luxe Enter your recommendation: Gr 4202954_Cheese Good job!
Author   snwau
🌐
Programiz
programiz.com › csharp-programming › library › string › format
C# String Format() (With Examples)
0 and 1 represent the first and second objects in the method ("Programiz" and "C# Programming") -20 and -14 represent the width of "Programiz" and "C# Programming" respectively. Since -20 and -14 are negative numbers, "Programiz" and "C# Programming" are left-aligned. ... using System; namespace CsharpString { class Test { public static void Main(string [] args) { DateTime date = new DateTime(2015, 12, 31); // format string string strDate = String.Format("{0:D}", date); Console.WriteLine(strDate); Console.ReadLine(); } } }
🌐
Dot Net Perls
dotnetperls.com › format
C# - string.Format Use - Dot Net Perls
Programs can use format strings directly inside the Console.Write and Console.WriteLine methods. We can call Console.WriteLine with the same arguments as string.Format. using System; class Program { static void Main() { string left = "hello"; string right = "friend"; Console.WriteLine("{0}, {1}!", left, right); } }
🌐
Medium
medium.com › vicipyweb3 › mastering-leading-zero-magic-a-friendly-guide-to-formatting-leading-zeros-in-python-3cb934d7aa4f
Mastering Leading Zero Magic: A Friendly Guide to Formatting Leading Zeros in Python | by PythonistaSage | ViciPyWeb3 | Medium
May 3, 2023 - The f-string formats it with a minimum width of 2 characters, padding with a leading zero to get the result '07'. If you have a number with more digits than the specified width, it won’t be truncated or altered. For example: number = 123 formatted_number = f"{number:02}" print(formatted_number) ...
🌐
Python
docs.python.org › 3 › library › string.html
string — Common string operations
Given field_name, convert it to an object to be formatted. Auto-numbering of field_name returned from parse() is done by vformat() before calling this method. Returns a tuple (obj, used_key). The default version takes strings of the form defined in PEP 3101, such as “0[name]” or “label.title”. args and kwargs are as passed in to vformat().