✨ 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

νƒœκ·Έ:

μΉ΄ν…Œκ³ λ¦¬:

μ—…λ°μ΄νŠΈ: