Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » More String Functions [FEATURE REQUEST]
More String Functions [FEATURE REQUEST] [message #3816] Wed, 28 June 2006 12:59 Go to next message
Rikus is currently offline  Rikus
Messages: 10
Registered: June 2006
Location: South Africa
Promising Member
May not have found it, but I wonder if it would be possible to add a few more string functions to the String Class and WString Class
1. void Replace(String oldString,String newString); //replaces within string
2. void Replace(char *oldString,char *newString);//replaces within string
3. String Replace(String oldString,String newString);//replaces within new string and returns the new string
4. char[] ToCharArray(); //returns a copy buffer String. The problem is with GetBuffer is if you want to use it to copy the buffer to another buffer (for example temp buffer) you have to
1. char *buffer = new char[String.GetLength()];
2. char *strbuffer = String.GetBuffer();
3. strcpy(buffer,strbuffer);
4. String.ReleaseBuffer();

where this would be nice
1. char *buffer = String.ToCharArray();


P.S. Topic name edited by fudadmin

[Updated on: Wed, 28 June 2006 13:07] by Moderator

Report message to a moderator

Re: More String Functions [FEATURE REQUEST] [message #3817 is a reply to message #3816] Wed, 28 June 2006 14:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Add 4:

First of all, GetBuffer is deprecated, you should use StringBuffer instead.

Using "free pointer" data in U++ is quite untypical, reserved just for dirty deep implementation issues, way too untypical for providing the member function.

However, if you need a lot of these, I would recommend using helper function like:

char *NewCopy(const String& s);

Mirek
Re: More String Functions [FEATURE REQUEST] [message #3818 is a reply to message #3817] Wed, 28 June 2006 14:06 Go to previous message
Rikus is currently offline  Rikus
Messages: 10
Registered: June 2006
Location: South Africa
Promising Member
Thanks for response. Will try it out.
Previous Topic: Translation Problems (German)
Next Topic: Error in "NTL - moveable" documentation?
Goto Forum:
  


Current Time: Sun Apr 28 11:26:33 CEST 2024

Total time taken to generate the page: 0.06397 seconds