2

I am try to replace the cyrlic characters by using Latin The following codes works

val kztext83: String = kztext82.replace('ə','ä')

but the actual translation is not ä , it is a'

Since a' is two character i am getting errror for

val kztext83: String = kztext82.replace('ə','a'')

Error is - too many character in character literal ?

I tried many ways including creating string , not fixing the issues

1
  • I try "ə".replace("ə","a'") in the kotlin REPL and it works Commented Nov 17, 2017 at 17:01

1 Answer 1

4

Instead of replacing chars, try using Strings:

val kztext83: String = kztext82.replace("ə","a'")

Which means replacing the double quotes with single.

You can't have two chars in a single char ('a' is a char object) meaning 'a\'' is not valid.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.