How to compare strings that came from input reader?

I want to create simple REPL program, you have the infinite loop, but when you type “exit” the loop is break. here is my code:

package simple_repl

import "core:fmt"
import "core:os"
import "core:bufio"
import "core:strings"

main :: proc () {
    reader: bufio.Reader
    
    in_stream := os.stream_from_handle(os.stdin)
    bufio.reader_init(&reader, in_stream)
    for {
        fmt.print(" REPL > ")
        err := os.flush(os.stdin)
        text, _ := bufio.reader_read_string(&reader, '\n')

        if strings.compare("exit", text) == 0 {
            break
        } else {
            fmt.println("command: ", text)
        }
    }
}

but the infinite loop is not break when i typed command “exit”, i thought the problem was in the strings compare() function, is there way to doing correct string comparison in odin?

I got the answer, i’m not trimmed the whitespace from the text, thanks !!!

the correct code :

package simple_repl

import "core:fmt"
import "core:os"
import "core:bufio"
import "core:strings"

main :: proc () {
    reader: bufio.Reader
    
    in_stream := os.stream_from_handle(os.stdin)
    bufio.reader_init(&reader, in_stream)
    for {
        fmt.print(" REPL > ")
        err := os.flush(os.stdin)
        text, _ := bufio.reader_read_string(&reader, '\n')

        if strings.compare("exit", strings.trim_space(text)) == 0 {
            break
        } else {
            fmt.println("command: ", text)
        }
    }
}