[IOS bug] string.Replace always returns null
See original GitHub issueDescription
string.Replace
always returns null when run on IOS, while it returns correctly when running on Android.
Steps to Reproduce
string test = "1 2 3 4 ";
string t1 = test.Replace(" ", @",");
t1 should return “1,2,3,4,”, and it does on Android, however t1 is null on IOS.
Version with bug
6.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 15
Did you find any workaround?
No response
Relevant log output
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Checking for null value (not nil or NSnull) in swift always ...
String ' the same error persist. I came to know that there is no equivalent of "null" in swift. Is there any hack...
Read more >String.Format Method (System)
Converts the value of objects to strings based on the formats specified and inserts them into another string. If you are new to...
Read more >str_replace - Manual
This function returns a string or an array with all occurrences of search in subject replaced with the given replace value. To replace...
Read more >String functions | BigQuery
Returns an empty string if the code point is 0 . If an invalid Unicode code point is specified, an error is returned....
Read more >JSON.stringify() - JavaScript - MDN Web Docs
The JSON.stringify() static method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@danielftz Are you seeing this in the debugger, or is the actual result in code
null
? If you callSystem.Diagnostics.Debug.WriteLine(t1);
, does it outputnull
or1,2,3,4,
to the console?We’ve been having some debugger issues in VS, I’m wondering if this is what you’re seeing.
You are correct, Debug.WriteLine() shows the correct output. I was checking the variable value by hovering over it when setting a breakpoint, and the bug shows up.