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: String Function
Topic Summary:
Created On: 29-Jan-2007 13:06
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.
Answer This question was answered by Paul Worrall, on Monday, January 29, 2007 2:18 PM

Answer:
There is a function 'name(Module m)' that returns the unqualified name of a module. If you need to start from a string then you could use a regular expression, e.g.:

string s = "/Project/Folder/ModuleName"
if matches("[^/]*$", s) then print s[match 0]
 29-Jan-2007 13:06
User is offline View Users Profile Print this message


Lisa Carver

Posts: 61
Joined: 15-Jun-2005

Hi

I feel that this must be simple, but I am struggling.

I need to extract the Module name (the text up to the latter "/" from the full path string of a module) i.e.

/Project/Folder/ModuleName

I need to extract ModuleName into another string if possible.

Any pointers gratefully received.
Thanks

Report this to a Moderator Report this to a Moderator
 29-Jan-2007 13:44
User is offline View Users Profile Print this message


Paul Worrall

Posts: 87
Joined: 30-Sep-2003

Answer Answer
There is a function 'name(Module m)' that returns the unqualified name of a module. If you need to start from a string then you could use a regular expression, e.g.:

string s = "/Project/Folder/ModuleName"
if matches("[^/]*$", s) then print s[match 0]
Report this to a Moderator Report this to a Moderator
 29-Jan-2007 14:18
User is offline View Users Profile Print this message


Lisa Carver

Posts: 61
Joined: 15-Jun-2005

Thanks so much, thats done it!
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 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 1 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.