> For the complete documentation index, see [llms.txt](https://heunnajo.gitbook.io/java/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://heunnajo.gitbook.io/java/collection-framework/string.md).

# String

String 입력받을 때 사용하는 함수

1. .next( ) : 공백 단위로 문자열 읽는다.

```java
String str = sc.next();
```

2\. nextLine( ) : Enter 단위로 문자열 읽는다. (Enter 입력은 \r\n으로 구성된 두개의 문자이다.)

```java
String str = sc.nextLine();
```
