|
Ok, having googled a bit more, the terminology is interpolate.
I have, say, 5 colours that I need to interpolate across a Color[256].
|
|
|
|
|
Hi,
I have a string which looks something like:
ABCDEF\\123456
I am looking to return 123456, it will always be 6 characters long. I tried IndexOf and LastIndexOf on the \ but they both returned the same index number. Isn't there a Right function like in Visual Basic?
Thanks
Brendan
|
|
|
|
|
You could use substring. If it's always the last 6 chars you want then this should work:
string newString = oldString.SubSTring(oldString.Length-7, 6);
Might be an even easier way though.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
I found the answer:
string MyString = "ABCDEF\\123456";
string End = MyString.Substring(MyString.Length - 6);
|
|
|
|
|
You should NOT rely on the *expected* length of the string.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
If you're going to need this functionality regurlarly you could create an extension method.
public static class Extensions
{
public static string Right(this string str, int length)
{
if (length < str.Length)
return str.Substring(str.Length - length);
return str;
}
} then, so long as you've added the namespace you put the above into in your using statements at the top you can use it like any other built in string method i.e.
string x = @"ABCDEF\\123456";
Console.WriteLine(x.Right(6));
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
modified on Friday, August 29, 2008 5:53 AM
|
|
|
|
|
First, IndexOf and LastIndexOf is going to return the same value because there's only one instance of the character you're looking for.
Second, there are several ways to do what you want. You could use the string.Split function...
string myString = "abcdef\\123456";
string[] parts = myString.Split("\\");
string leftSide = parts[0];
string rightSide = parts[1];
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Does anybody know how I can get my hands on Visual Studio 2003.
I've been through two collections of DVDs and was not able to find Visual Studio 2003.
I've also tried to search the Web for a place where it is possible to download it, but with no luck.
Can anybody help ?
|
|
|
|
|
You could probably download it using bittorrent, search torrentz.com and your bound to find it
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
SK Genius wrote: You could probably download it using bittorrent, search torrentz.com and your bound to find it
Dont encourage pirated softwares.
Infact, MS itseft offers you 3 months full functioning trials of Visual Studios...
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I'm not intending to pirate anything. I have a MSDN subscription but no VS2003 found in it, and the company I'm currently working for has a MSDN subscription as well. But with no VS2003. and we need it.
|
|
|
|
|
Kenneth Broendum wrote: I have a MSDN subscription
In that case, Visual Studio .NET 2003 is downloadable from
the MSDN Subscriber Site[^].
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Just because something is on a file sharing network, it doesn't mean it's pirated. You can get illegal software but there is also a large amount of legitimate downloads.
I apologise if what I said implies the download and use of illegal software, it is not what I intended.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
I dont think you can download the 2003 version any longer. It depends what you need it for, but with 2005 there are Free versions of certain programs called "Express" versions.
Also, this is a download for the trial of Visual Studio 2005:
http://msdn.microsoft.com/trial/
And from here, you can get the Visual Studio 2008 trial:
http://msdn2.microsoft.com/en-gb/vstudio/default.aspx
Again 2008 has express editions which are completely free.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi Manas.
Thanks for trying to help but I have both VS2005 and VS2008.
I need VS2003 because we are targeting older ATM PCs running Windows XP with 256MB Ram and 800MHz CPUs. The .NET 1.1 framework is already installed and running on these machines, and since resources are low we need to target this verswion of the framework.
I would certainly prefer to install a later version of the framework but that is unfortunately not an option.
But thanks
|
|
|
|
|
Hi
you could also use MsBee[^] to compile a Project for the 1.1 Framework using VS 2005.
|
|
|
|
|
you can use sharpdevelop and its free
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Hi
Is there any way to understand a running application is calling a function, method or sub? In other words I want to communicate with other running proccesses.
For example I want to know when Notepad.exe is calling the Open function.
Thanks.
|
|
|
|
|
pm526467 wrote: For example I want to know when Notepad.exe is calling the Open function.
Its a bit difficult(or should i say impossible) with C#.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
One possible way i can think of is to monitor the open windows, when you find a window with the title 'Open' check to see who the owner is, and compare this with any instances of notepad that are currently open. If it matches then you know notepad is opening a file.
Of course this might not work out, and only works for this one case. I'm afraid you might be stuck.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Yes, it works only for this case but I want to dynamically manage all events that an application wants to call.
Thanks anyway.
|
|
|
|
|
How i can to load image to my form by means of Image.FromStream?
I have a tiff-picture which has high resolution(55334*12443)
Part of code,which used for this purpose --> "img = Image.FromFile(openFileDialog1.FileName);"gives error in result(memory exception)!
thanks in advance!!!
|
|
|
|
|
I'll tell you the problem, that image will take up just under 2GB of space in your RAM. So no matter where you load it from, if you try to load the whole thing you will run out of memory.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Hi,
I hv a query which retrives the data frm data base and also calculates sm value for few colums i get the value as infinity.so how can i hv it in my query so that it should display zero and find the sum of that column.
Here is my query...Pls sm one help...
OleDbCommand cmdMtdDays = new OleDbCommand("with member COSt as sum({[Dimension Time].[Day Text].[" + FromFilter + "]},[Measures].[Out Standing Amt]) member AV_MTD as sum(" + QueryFilterMTD + ",[Measures].[Inv Amt]) member COSMTD as (AV_MTD/" + day + ") member MTDDAYS as (iif(COSt=0,null,(COSt/COSMTD))) select {MTDDAYS} on columns, nonempty([DLOMAS].[OMVALU].[OMVALU]) on rows from COS", con);
Regards,
Annu
|
|
|
|
|
Don't Repost.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|