The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Extract string between <> rakeshou Shell Programming and Scripting 14 11-21-2007 01:10 PM
Extract digits at end of string offirc Shell Programming and Scripting 6 11-20-2006 11:57 AM
Extract String sehgalniraj UNIX for Dummies Questions & Answers 1 09-25-2006 01:35 PM
Extract String bestbuyernc Shell Programming and Scripting 5 11-14-2005 03:42 PM
How to extract a portion of a string from the whole string ds_sastry UNIX for Dummies Questions & Answers 2 09-29-2001 11:40 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-23-2007
namrata5 namrata5 is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 6
How to Extract string?

Hi,

I have string object,

string s1="abcdefghijk";

And I want to extract some part of string into the other string. e.g. extract 'def' into the string s2.

Is there any function to extract the string. I have included 'string.h' file.
I want the function which can extract string by mentioning the starting index and length of string or ending index.
  #2 (permalink)  
Old 10-23-2007
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,800

Code:
string s2 = s1.substr(4,3);

  #3 (permalink)  
Old 10-24-2007
namrata5 namrata5 is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 6
Thank you very much !
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0