Tagged articles
String Formatting
21 articles · Page 1 of 1
This tutorial walks through Java's core numeric and character utilities, covering number wrapper classes and autoboxing/unboxing, the Number hierarchy, formatted output with printf/format, DecimalFormat patterns, and the Math class’s constants and methods for arithmetic, logarithmic, trigonometric, and random number generation, all illustrated with concrete code examples.
AutoboxingDecimalFormatJava
0 likes · 15 min read

This tutorial walks through Python's two main string formatting techniques—classic % placeholders and modern f‑strings—detailing specifiers like %d, %f, %s, %.2f, and providing concrete code examples that show how each method formats name, age, and salary variables.
PythonString FormattingTutorial
0 likes · 3 min read

Discover five versatile techniques for Python’s print()—from simple string concatenation and comma separation to modern f‑strings, percent formatting, and the .format() method—complete with clear examples and guidance on when to use each approach for clean, readable output.
Code ExamplesString Formattingf-strings
0 likes · 5 min read

Python 3.14 adds the PEP 750 T‑string syntax to address security risks in existing string formatting methods like f‑strings, offering a template‑based approach that enables safer handling of user input, SQL queries, and HTML rendering.
PythonSQL injectionSecurity
0 likes · 11 min read

This article introduces a continuously updated Spring Boot 3 case collection and provides a step‑by‑step guide to nine Java string‑formatting methods—including String.format, MessageFormat, text blocks, number grouping, rounding, zero‑padding, printf, whitespace, and concatenation—complete with runnable code examples.
JavaMessageFormatString Formatting
0 likes · 6 min read

This article explores Python's string formatting techniques—from the classic % operator and the flexible .format() method to modern f-strings—detailing their syntax, advantages, disadvantages, and additional tools like format_map, Template, and zfill, helping developers choose the most readable and efficient approach.
String Formattingf-stringsformat method
0 likes · 7 min read

This guide explains Python's dictionary unpacking using the ** operator, showing how it streamlines passing keyword arguments to functions and formatting strings, while covering basic examples, practical advantages, and important precautions to avoid common errors.
Code TutorialDictionary UnpackingPython
0 likes · 5 min read

This article presents ten practical Python tips and tricks, covering list comprehensions, efficient list traversal, element swapping, list initialization, string construction, tuple returns, dictionary access, library usage, slicing and stepping, and indentation best practices, each illustrated with clear code examples.
PythonString Formattingdictionary
0 likes · 10 min read

This article explains Python's % placeholder for string formatting, covering basic specifiers, multiple value substitution using tuples, dictionaries, and f-strings, and advanced formatting options like width, padding, and precision, accompanied by clear code examples.
String FormattingTutorialpercent operator
0 likes · 5 min read

This article explains how PHP's number_format() function formats numbers with thousands separators, custom decimal points, and currency symbols, providing basic syntax, advanced parameter usage, and practical code examples such as price formatting and handling negative values.
Code ExamplesPHPString Formatting
0 likes · 5 min read

This article explains how to format positive integer strings with thousand separators in Python by using a concise regular expression and the re.sub function, providing a clear code example and linking to the official documentation for further reference.
PythonString Formattingprogramming fundamentals
0 likes · 4 min read

The article explains how Python’s !s and !r format specifiers invoke the __str__ and __repr__ methods respectively, illustrates their output differences with examples, and discusses when each representation is appropriate for debugging and readable string conversion.
String Formatting__repr__str
0 likes · 3 min read

This article demonstrates how to serialize bank API parameters into a fixed‑length string using Java annotations and reflection, covering the initial naïve implementation, its drawbacks, and a refactored solution that centralizes formatting, signing, and request logic for maintainable backend code.
APIAnnotationsJava
0 likes · 9 min read

This article explains Python's two main string‑formatting techniques—the legacy percent (%) operator and the newer format() method—detailing their syntax, flags, width, precision, type codes, and providing numerous code examples with expected output.
String Formattingexamplesformat method
0 likes · 8 min read

This article explains Python's two string‑formatting approaches—the C‑style % operator and the more powerful format() method—covering integer, float, and string placeholders, alignment, precision, and advanced usage with clear code examples.
PythonString Formattingformat method
0 likes · 6 min read

This guide walks you through advanced Python string formatting techniques—including zero‑padded integers with %03d, fixed‑point floats with %.2f, and versatile %s placeholders—complete with code snippets and visual examples to help you format IDs, weights, and more efficiently.
Code ExamplesString Formattingfloat precision
0 likes · 5 min read

This tutorial explains Python 3.6's f‑string formatting, covering basic usage, expression evaluation, lambda functions, quoting rules, brace escaping, padding, numeric specifiers, width/precision control, date formatting, and a complete multiplication‑table case with code samples.
Code ExamplesPythonString Formatting
0 likes · 10 min read

This guide explains how to write multi‑line text in YAML configuration files, covering techniques to keep paragraph breaks when displaying the value and methods to collapse line breaks for a single‑line output, complete with code examples and practical differences.
DevOpsMultiline StringsString Formatting
0 likes · 5 min read

This article explains Python's str.format() method introduced in Python 2.6, covering its basic syntax, positional and named arguments, object formatting, numeric formatting options, alignment, fill characters, type specifiers, brace escaping, and custom template usage with clear code examples.
Code ExampleString Formattingformat-specifiers
0 likes · 4 min read

This guide presents ten practical Python techniques—from list comprehensions and efficient looping to elegant swapping, list initialization, string formatting, multiple returns, dictionary access, using Counter, slicing, and consistent indentation—helping new programmers write cleaner, more Pythonic code.
Code stylePythonString Formatting
0 likes · 9 min read

This article introduces Python's string formatting operators, explains how %r converts values to strings and %d formats integers, and demonstrates their usage with concrete code examples and output, guiding beginners through building formatted messages step by step.
PythonString FormattingTutorial
0 likes · 2 min read
