Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

can not find replace method for strings


  • Please log in to reply
1 reply to this topic

#1 kerk-akker

kerk-akker

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationNetherlands

Posted 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



#2 ShVerni

ShVerni

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationNew York, New York

Posted 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 topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.