home > 比較編 > Perl, PHP, Python, Ruby > strings >

ForNext

Only Do What Only You Can Do

052. sprintf

VBScript

JScript

Perl

my $fmt = "lorem %s %d %f";
sprintf($fmt, "ipsum", 13, 3.7)


PHP

$fmt = "lorem %s %d %f";
sprintf($fmt, "ipsum", 13, 3.7);


Python

'lorem %s %d %f' % ('ipsum', 13, 3.7)

fmt = 'lorem {0} {1} {2}'
fmt.format('ipsum', 13, 3.7)

Ruby

"lorem %s %d %f" % ["ipsum",13,3.7]



PowerShell

Scala

F#

C

C++

C++Builder

VC++

C#

Java

Objective-C

D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

関数型

inserted by FC2 system