473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

arg! I just want a String.Contains()!

That's all, that and one or two other simple helper functions that I
have to re-write over and over and over :(

Why is there no String.Contains()? I look for it every day!
Tis just return str.IndexOf(find)!=-1;

Rants overwhelm the raves, since it's no fun to gush over a well done
framework :) GJ guys.

Jul 21 '05 #1
3 1065
Andrew Backer wrote:
That's all, that and one or two other simple helper functions that I
have to re-write over and over and over :(

Why is there no String.Contains()? I look for it every day!
Tis just return str.IndexOf(find)!=-1;

Rants overwhelm the raves, since it's no fun to gush over a well done
framework :) GJ guys.


There's no one stopping you from writing your own assemblies and putting
them in the GAC for use by any application.
Jul 21 '05 #2
Create your own helper classes and reference them in your projects. No
reason to write things over and over.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Andrew Backer" <aw******@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
That's all, that and one or two other simple helper functions that I
have to re-write over and over and over :(

Why is there no String.Contains()? I look for it every day!
Tis just return str.IndexOf(find)!=-1;

Rants overwhelm the raves, since it's no fun to gush over a well done
framework :) GJ guys.

Jul 21 '05 #3
.... yes, i know, and I do, and they are for different clients and
sharing technically isn't allowed or I don't control the whole project
or the damn thing is so simple, and I like things self contained so no
gac and no real good reason...

// (from java? I don't remember) , I would like to be able to do :
string funkeyText = this.txtInputThingy.text;
if ( funkeyText.Contains( "key") ) { ... }

It's just so *natural* that I keep typing it in automatically and going
"whoops" over and over again. Every time I say "oh! that's right! why
isn't that there? everything else is?". It had just happend for the
Nth time, so I wrote about it. Other than that I have almost no use
for string helpers, since the class is so friendly to start with.

- Andrew

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: aa | last post by:
Anybody know the solution to trailing space in argument of Runtime.getRuntime().exec(arg), Process p = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler C:\\Documents and...
4
by: Sam Smith | last post by:
I am using optparse for the commandline parsing for my programs. I was wondering if it is possible to detect if an option or option-arg has been specified on the commandline by the user or not....
1
by: Manlio Perillo | last post by:
Hi. As I can see, the arg function for complex numbers -- for polar representation: z = abs(x) exp(arg(z)) -- is missing! Why? Thanks and regards Manlio Perillo
8
by: Hunter Hou | last post by:
hello, I'm reading <the C++ programming language>, here's a question for bind2nd. Who can help explain what on earth bind2nd is working? .... void rotate_all( list<Shape*>& ls, int angle ) {...
18
by: Daniel Schüle | last post by:
Hello all, I often have to deal with complex numbers using python iteractive as calculator I wonder why there are no methods like arg, abs well one can use c = 1+1j abs(c)
2
by: Gvs | last post by:
Hi, I'm trying to compile an example semaphore .c file taken straight from the internet, but it won't compile with the error; gcc seminit.c -o seminit seminit.c: In function `main':...
2
by: flogic | last post by:
Hi i m a newbie to python .. jus started to learn ...am quite confused about variable arguments used in python functions and in init. i dont where to use **keys , **kwds,*args ...etc... if...
16
by: Tuomas | last post by:
>>def g(*arg): .... return arg .... ('foo', 'bar') .... (('foo', 'bar'),) TV
1
by: spam_to_dev_null | last post by:
The following C++ program compiles without warning message under RedHat 9.4 with a recent version of g++: // all put in file main.cpp for simplicity #include <stdio.h> class MyClass { public:...
3
by: dissectcode | last post by:
Hello - I have this simple code that gives me the warning: "int format, pointer arg (arg 3)" BOOL read, write; FILE *t; more code... fprintf( t, "Operation is %c\n",...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.