![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | String handling: ordinal or invariant or current-culture? Given this C#:- String filePathname1 = ... String filePathname2 = ... if (String.Equals (filePathname1, filePathname2, StringComparison.OrdinalIgnoreCase)) what would the equivalent PowerShell script be? E.g. would it be:- if ($filePathname1 -ieq $filePathname2) I.e. - do -eq and -ieq perform ordinal string comparisons? - if not, then what? - is the behaviour defined, and fixed for all time? - if the behaviour is ordinal and I want a cultural comparison, do I have to kick-up to .NET? - how about the -lt and -gt operators? - is the bevahiour documented anywhere? Also, are there interesting and important things to note re. PowerShell's value-to-string and string-to-value conversions (current culture vs. specified culture vs. invariant culture)? I think it would be great to have this sort of thing nailed down. It would help me to be able to script in confidence. Many thanks. Andrew |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Vista Ultimate SP1 - popup.exe - Ordinal Not Found | Vista General | |||
| Could not find any resources appropriate for the specified culture or the neutral culture | .NET General | |||