Solved

Parsing Strings

Posted on 1997-05-18
3
260 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
  • 2
3 Comments
 

Author Comment

by:chrisj051697
Comment Utility
Edited text of question
0
 
LVL 1

Accepted Solution

by:
sleach earned 50 total points
Comment Utility
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
Comment Utility
Thanks Again
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now