473,396 Members | 1,895 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,396 software developers and data experts.

ATcommand in .NET

Some xBase languages have a command called AT (remember this?)

In C# this might look like

int retPosition = AT(searchedString, InString);

in xBase
dd = AT("DD", MASK)

It return the position in "dd" searching into "MASK" the "DD" string.

I was looking in the help, but i was unable to find it.

Some help?
Nov 16 '05 #1
3 1541
I believe you are looking for string.IndexOf().

string s = "shane";
int pos = s.IndexOf("ha");

ShaneB

"smeagol" <pedorro77.hotmail.com> wrote in message
news:up**************@TK2MSFTNGP14.phx.gbl...
Some xBase languages have a command called AT (remember this?)

In C# this might look like

int retPosition = AT(searchedString, InString);

in xBase
dd = AT("DD", MASK)

It return the position in "dd" searching into "MASK" the "DD" string.

I was looking in the help, but i was unable to find it.

Some help?

Nov 16 '05 #2
If I understand what you are asking for correctly, you want to know
where in the text string that the second string occurs. In .Net it is
built into the string objects to do this using the IndexOf method. For
example:

string name = "John";
int position = name.IndexOf("oh");
//position will have the value 1 as the o is in the second position in
the string

Hope that is what you were looking for.

Have A Better One!

John M Deal, MCP
Necessity Software

smeagol wrote:
Some xBase languages have a command called AT (remember this?)

In C# this might look like

int retPosition = AT(searchedString, InString);

in xBase
dd = AT("DD", MASK)

It return the position in "dd" searching into "MASK" the "DD" string.

I was looking in the help, but i was unable to find it.

Some help?

Nov 16 '05 #3
smeagol wrote:

It return the position in "dd" searching into "MASK" the "DD" string.

try the IndexOf() method of the string class, I think that will do what
you want.

Cheers Tim.
Nov 16 '05 #4

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

Similar topics

12
by: KalupaPaluku | last post by:
Hi, everybody! I would like to ask for your helps to solve this problem -- How to add new line in MessageBox, using VB 2005. i try using '&vbnewline&', but still can't work.
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.