Solved

Parsing Strings

Posted on 1997-05-18
3
289 Views
Last Modified: 2012-05-04
Hi I'm new to Delphi

Can you tell me how to break apart the following string into 3 components

Modem Name, Delimeter, Modem stirng

where the original string is in the form

USR-14.4 - AT&F

Component 1 is variable in my list of strings and is"USR-14.4" in this expample

Component 2 is the delimeter and is " - " (space comma space) and is always the same.

Component 3 is the Modem Init string "AT&F' in this example and is also variable in the list of strings

I need to get just component 3 for writing to another part of my program

Thanks for the help

Chris
0
Comment
Question by:chrisj051697
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:chrisj051697
ID: 1336427
Edited text of question
0
 
LVL 1

Accepted Solution

by:
sleach earned 50 total points
ID: 1336428
var
ModemString, ModemName, Delimiter, Data:  string;
begin
{initialize data & delimiter}
Data := 'USR-14.4 - AT&F';
Delimiter := ' - ';

ModemName := copy(data, 1, pos(delimiter, data)-1);
ModemString := copy(data, pos(delimiter, data)+3, length(data));
end;

0
 

Author Comment

by:chrisj051697
ID: 1336429
Thanks Again
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question