Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Parsing Strings

Posted on 1997-05-18
3
Medium Priority
?
304 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 100 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

609 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