1

I'm trying to convert a String to a Char array in Swift. I use RemObjects' Silver compiler with Visual Studio. However, printing the array doesn't give the same result wether using an intermediate variable or not!

var text: String = Console.ReadLine().uppercaseString()
var textChar = [Char](text)

for var index = 0; index < textChar.count; index++ {
    println(textChar[index]) // Correct
    var a = textChar[index]  // Wrong result
    println(a)
}

Any idea to solve this problem?

marvell
  • 67
  • 1
  • 6
  • I have no experience with that compiler, but in any case, you should provide a concrete example of input, actual output and expected output. – Martin R Feb 13 '16 at 11:24
  • What version of the compiler are you using? and what platform — i assume, from the `Console.ReadLine()`, .NET? This snippet doesn't compile for me at all, for various good reasons. – marc hoffman Feb 16 '16 at 22:00
  • This code compiles for me: http://paste.ie/view/5e93ee11 and prints the same value twice for each char, as expected (for value ASCII chars) – marc hoffman Feb 16 '16 at 22:05

0 Answers0