473,327 Members | 2,012 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,327 software developers and data experts.

How do I delete part of the String?

Hello,
my problem is quite simple to explain.
I have the following string:
"type computer {dell}"
and I want to remove the {dell}
So that the output on the screen type computer
Or delete any clause between the two brackets {}
How do i do that ?
Thanks for your help.
Nov 26 '12 #1
5 2881
johny10151981
1,059 1GB
your requirement is not very much clear. there is lots of if issue. anyway the simplest method would be search first { then search } and finally copy the part out of that range.
Nov 26 '12 #2
zmbd
5,501 Expert Mod 4TB
Look at the replace function using iteration.
Nov 26 '12 #3
Rabbit
12,516 Expert Mod 8TB
You can download a regex library or you can build a rudimentary one for you purposes. You just need to find the indexes of your start and end characters and substring out the pieces you want.
Nov 26 '12 #4
johny10151981
1,059 1GB
you can download pcre library. it is written in C for pearl equivalent regular expression.
Nov 27 '12 #5
whodgson
542 512MB
as Rabbit says:
with the C++ <string> header file
if string s="type computer {deli}"
and string s1=s(erase 14,6)then s1= "type computer "
Nov 28 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: José Carlos | last post by:
Hi. How can i part a big string to block of information of (4Kb for example).? i´m trying send it from a socket client to server and how can i calculate the time it´s coming. Thank you. ...
5
by: Mart | last post by:
Hi everybody, I plan to have a LOT of SQL string in my app. So I need your advice for this. Is it a good idea to store all my SQL string in the app.config file? For a maintenance point of...
2
by: memosa | last post by:
Hi, friends: This is my programme (work on Microsoft visual c++) and I have two question . First, I want to say that there is no error but I need a little help. This is a small programme...
2
by: TCB | last post by:
How can I separate multiple email addresses entered in a single textbox so I can send email in ASP.NET 2.0, the email addresses are separated by (,) or (;) Thanks
5
by: Martin Jørgensen | last post by:
Hello again, Sorry to bother but I guess my C++ book isn't very good since it obviously contains errors so the program code doesn't work with g++. However I don't understand what the problem...
4
by: jimboker | last post by:
i have a program that uses linked lists. i declared the linked list and functions as follows: header.h #pragma once struct DataPart { char LastName;
3
by: alanbe | last post by:
Someone filled out a comment form to me with the following string within the message: #file=E:\\util\\xr32\\Projects\\www42t35Href.txt The comments are stored in a mysql database When...
3
by: JLC | last post by:
Hi, I am very much a beginner and would love some help here. I seem to get a blank line in the text box I am getting these entries from and I wanted to check for that in my array and then delete...
6
by: Nethali | last post by:
Hi all, Please explain me the following: I have struct as follows: struct Link { void* data; Link* next;
2
dbanning
by: dbanning | last post by:
I am trying to remove part of a string and place it into another variable the string is a filename eg "C:\help\demo\sample.txt" I want to remove and resave into a new string just the file...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.