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 » How Use Substring Search?
How Use Substring Search? [message #3204] Fri, 12 May 2006 18:13 Go to next message
zaurus is currently offline  zaurus
Messages: 42
Registered: May 2006
Member
Hi!

I have some difficulties in using the substring search.

sText = "This is a long night.";
iPos = sText.Find("long");

I was thinking that it should work like this, but it doesn't. Some small example would help. I couldn't find anything in existing examples.

Sorry if this is a dumb question. I'm still new to U++, but like it a lot.

Thanks for any help

Zaurus
Re: How Use Substring Search? [message #3205 is a reply to message #3204] Fri, 12 May 2006 18:49 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
zaurus wrote on Fri, 12 May 2006 12:13

Hi!

I have some difficulties in using the substring search.

sText = "This is a long night.";
iPos = sText.Find("long");

I was thinking that it should work like this, but it doesn't. Some small example would help. I couldn't find anything in existing examples.

Sorry if this is a dumb question. I'm still new to U++, but like it a lot.

Thanks for any help

Zaurus



Well, this works:

#include <Core/Core.h>

CONSOLE_APP_MAIN
{
	String sText = "This is a long night.";
	int iPos = sText.Find("long");
	Cout() << iPos << "\n";
}


Mirek
Re: How Use Substring Search? [message #3226 is a reply to message #3204] Sun, 14 May 2006 16:54 Go to previous message
zaurus is currently offline  zaurus
Messages: 42
Registered: May 2006
Member
Hi Mirek!

Thanks for the fast reply. I had a stupid other error in the same line with the 'Find' function and I was always digging around the 'Find'. Sometimes it helps not to squeeze too many things in one line of code.

Keep up your good work.
Previous Topic: Header Issues[SOLVED]
Next Topic: short-hand
Goto Forum:
  


Current Time: Sun Apr 28 13:24:48 CEST 2024

Total time taken to generate the page: 0.02812 seconds