Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: split string into word array
Topic Summary: string to word array
Created On: 26-Sep-2007 16:48
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 26-Sep-2007 16:48
User is offline View Users Profile Print this message


Tarun Inabathuni

Posts: 59
Joined: 18-Jan-2005

how can i split a string into a word array..
Report this to a Moderator Report this to a Moderator
 26-Sep-2007 18:36
User is offline View Users Profile Print this message


Scott Boisvert

Posts: 348
Joined: 14-Apr-2006

Put the string into a buffer.

Use a while loop to find the spaces.

break up the string based on the spaces and put each word into an index in the array.

Like so:



-------------------------
Scott Boisvert
Engineering Tools Administrator
L-3 Communications - Avionics Systems
scott.boisvert@l-3com.com

Edited: 26-Sep-2007 at 18:43 by Scott Boisvert
Report this to a Moderator Report this to a Moderator
 27-Sep-2007 10:25
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Here is an alternative approach using a simple implementation of the C function strtok().

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 2 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.