readLine
β¨ readLine(strippingNewline:)
Returns a string read from standard input through the end of the current line or until EOF is reached.
β‘ νμ€ μ λ ₯μμ νμ¬ μ€ λκΉμ§ λλ EOF μ λλ¬ν λκΉμ§ μ½μ λ¬Έμμ΄μ λ°ννλ€.
cf. EOF [ End Of File ]
νμΌμ λ
λ°μ΄ν° μμ€λ‘λΆν° λ μ΄μ μ½μ μ μλ λ°μ΄ν°κ° μμμ λνλΈλ€.
Declaration
func readLine(strippingNewline: Bool = true) ->
String?
Parameters
strippingNewline
If true, newline characters and character combinations are stripped from the result;
otherwise, newline characters or character combinations are preserved.
The default is true.
β‘ true μ΄λ©΄, κ°ν λ¬Έμμ λ¬Έμ μ‘°ν©μ΄ μ κ±°λλ€.
β‘ κ·Έλ μ§ μμΌλ©΄, κ°ν λ¬Έμ λλ λ¬Έμ μ‘°ν©μ΄ μ μ§λλ€.
β‘ κΈ°λ³Έ κ°μ true μ΄λ€.
Return Value
The string of characters read from standard input.
If EOF has already been reached when readLine() is called, the result is nil.
β‘ νμ€ μ
λ ₯μμ μ½μ λ¬Έμμ΄μ΄λ€.
β‘ readLine()
μ΄ νΈμΆλ λ EOF
μ μ΄λ―Έ λλ¬νλ€λ©΄, κ²°κ³Όκ°μ nil
μ΄λ€.
π Reference
readLine