https://kotlinlang.org logo
#android
Title
# android
t

Tran Thang

02/01/2023, 12:31 PM
I have two string same as below: I want to concatenate two strings together in correct concatenation order. but I don't know why after concatenating the above two strings it is reversed. Does anyone have a solution to this problem?
s

Steve Georgakis

02/01/2023, 12:34 PM
does
str2
contain Arabic, Hebrew, or Farsi characters? I cannot recognize them. These languages are read from right to left and it is probably affecting your string representation
actually this is what the IDE is telling you on top
t

Tran Thang

02/01/2023, 12:36 PM
there are 2 string as below:
Copy code
val str2 = " היטצ "
val str3 = "ABC"
s

Steve Georgakis

02/01/2023, 1:14 PM
I understand that
str2
variable contains characters read from right to left, instead of left to right, correct? This is probably what makes the concatenation to be represented wrong
p

Peiming Wu

02/02/2023, 7:20 AM
Could it be an IDE-related issue? https://pl.kotl.in/vSu1AF01S
r

Richard Shea

02/12/2023, 8:40 AM
@Tran Thang Looks like str2 is Hebrew (RTL) and str3 (LTR). Can you try String template println("$str2$str3") and see how it looks like?
You can choose the direction from the blue bar from IntellJ.
13 Views