Hi,
I am trying to replace some characters in a string but it seems the replace method is not available on my system. I only have a very limited set of methods available.
Any tips ?
Br,
Arno
  | ||||||||||||||
can not find replace method for strings
Started by kerk-akker, Jan 21 2014 03:35 PM
1 reply to this topic
#1Posted 21 January 2014 - 03:35 PM Hi,
I am trying to replace some characters in a string but it seems the replace method is not available on my system. I only have a very limited set of methods available.
Any tips ?
Br,
Arno #2Posted 21 January 2014 - 05:51 PM Hello and welcome!
I'm afraid you're correct that the string replace method is not supported in the .Net Micro Framework. Two options come to mind:
You can to write your own replace method (you could even add it as an extension method for the string class if you wanted to get fancy), or use the string.Replace extension method here (it may need to be modified, I haven't looked at it): http://netmfcommonext.codeplex.com/
The probably better solution is to use the built in StringBuilder class which has a replace method: http://msdn.microsof...y/hh454420.aspx
To use StringBuider you'll need to add a reference to System.Text.
Hope that helps!
P.S. This seems to be a common problem, check out this post: http://forums.netdui...n-net-41-micro/ 0 user(s) are reading this topic0 members, 0 guests, 0 anonymous users | ||||||||||||||
|
||||||||||||||
This webpage is licensed under a Creative Commons Attribution-ShareAlike License. | ||||||||||||||