Switch case bug?

I can use ’ case 0…10: ’ or ’ case “a”…“z”: ’ in Xcode on Mac.
But I can’t use them in Silver (8.1.82.1741) for Visual Studio.
I want to use intervals.

Odd, are t sur you ar using .1741? i believe this was supposed to have been fixed last week. I’ll reopen.

Thanks, logged as bugs://71855

bugs://71855 got closed with status fixed.

I use Silver for VS(8.1.82.1745).
When I input every character in TxtBox, MessageBox always shows “Other”.
I can not understand why it goes.

func BtnCalc_Click(_ sender: System.Object!, _ e: System.Windows.RoutedEventArgs!) {
	var m : String
	var d : String
	if TxtBox.Text.isEmpty {
          d = " "
	} else {
          d = TxtBox.Text
	}
	switch d {
		case "0"..."9":
  		  m = "number"
		case "a"..."z":
    	 	  m = "Lower case"
		case "A"..."Z":
    		  m = "Upper Case"
		default:
   	 	  m = "Other"
	}
	MessageBox.Show(m)
}

Probably an issue with Strings vs. Chars. We’ll have a look.

Thanks, logged as bugs://71911

bugs://71911 got closed with status fixed.

I used Silver for VS(8.1.83.1751) immediately.
But, MessageBox could NOT show “Upper case” for “A” to “Z” and "Other " for any word.

I expect,
when I input “A” to “Z”, it will show “Upper case”.
when I input “a” to “z”, it will show “Lower case”.
when I input “0” to “9”, it will show “number”.
BUT,
when I input “Silver” or “1234” or “Windows10” or “cat”, it will show “Other”.
And more, of cause, { case “dog”: m = “Dog!”} in above the code,
when I input “dog”, it will show “Dog!”

yeah, that seems correct?

    switch d {
        case "cat":
            m = "Cat!"
        case "dog":
            m = "Dog!"
        case "007":
            m = "James Bond!"
        case "Silver":
            m = "Silver!"
        case "0"..."9":
            m = "Number"
        case "a"..."z":
            m = "Lower case"
        case "A"..."Z":
            m = "Upper case"
        default:
            m = "Other"
    }

Sorry, You’re right.
I write above codes in X code on Mac.
I understand when ‘d’ is “Windows10”, ‘m’ is “Upper case”.
BUT, Silver(8.1.83.1751) dose not work as expected.
I suppose Silver(1751) can not switch lower or upper case.

Ah, now i understand. So you think "A".."Z" should catch any string that orders higher than "A" and lower than “Z”, including, say "Apple"? I believe currently it will match exactly 26 strings, "A", "B", "C" etc thru "Y" and "Z". It won’t match any other strings starting with those same letters.`

I can see an argument for doing it the other way (and if that’s how Apple Swift does it, then we should, too), but note that most likely that won’t do what you expect it so do, exactly. "A".."Z" would then match "Apple" and "Xylophone", but it would still not* match "Zebra".

Thanks, logged as bugs://71953

bugs://71953 got closed with status fixed.

Ah the bug was that it was case insensitive compare, not sensitive. Fixed