Unexpected tokens (use ; to seperate expressions on the same line)
코드 :
var key: String = "KEY is"
/* "check" is name of String variable which can be null
Warning coming on following statement*/
var str : String = check?key.replace("KEY", "ABDS-ASDSA-DSSS")?:check
아이디어를 해결하는 방법은 무엇입니까?
왜 Elvis 연산자를 사용 하시겠습니까? 귀하의 변수 중 어느 것도 nullable이 아니기 때문에 무의미합니다. 또한,'check'를 초기화하지 않습니다. – Moira