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

ForNext

Only Do What Only You Can Do

181. read entire file into array or string

VBScript

JScript

Perl

@a = <$f>;
$s = do { local $/; <$f> };

PHP

$a = file("/etc/hosts");
$s = file_get_contents("/etc/hosts");

Python

a = f.readlines()
s = f.read()

Ruby

a = f.lines.to_a
s = f.read

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