함수 print()

(함수 echo()에서 넘어옴)
  다른 뜻에 대해서는 리눅스 echo 문서를 참조하십시오.
echo
print
Write

1 Bash[ | ]

echo "Hello World!"
# Hello World!
STR="Hello World!"
echo $STR
# Hello World!
echo -n 123
echo -n ABC
# 123ABC

2 C#[ | ]

Console.Write("Hello");

3 Go[ | ]

package main

import "fmt"

func main() {
    fmt.Print("hello" + "world")
    fmt.Print("1+1=", 1+1)
    // helloworld1+1=2
}

4 JavaScript[ | ]

document.write("hello");

5 Perl[ | ]

print 'hello';
print 'world';
use 5.010;
say('hello');
say('world');

6 PHP[ | ]

echo 'hello';
echo "hello";
echo('hello');
echo("hello");

$greeting = 'hello';
$greeting = "hello";
echo $greeting;
echo "$greeting";
echo '123';
echo 'ABC';
// 123ABC
print 'hello';

7 PowerShell[ | ]

Write-Host "Hello world!"

8 Python[ | ]

  • Python 2.x
import sys
sys.stdout.write("hello")
  • Python 3.x
print('hello')
print("hello")
print("hello", end="")
# hello
print("hello","world")
# hello world
print("hello", "world", end="123")
# hello world123

9 R[ | ]

print(1)
## [1] 1
print(1:3)
## [1] 1 2 3
print('hello')
## [1] "hello"
print("hello")
## [1] "hello"

10 Ruby[ | ]

print "hello"
# hello
print "123"
print "ABC"
# 123ABC

11 VB[ | ]

PRINT "hello"

12 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}