Forum
Forum
Verilog-AMS
Analysis
Modeling
Design
Theory
Welcome, Guest. Please
Login
or
Register.
Please follow the Forum
guidelines
.
Jul 17
th
, 2024, 12:46pm
Home
Help
Search
Login
Register
PM to admin
The Designer's Guide Community Forum
›
Simulators
›
Circuit Simulators
› String trim in SKILL
‹
Previous topic
|
Next topic
›
Pages: 1
String trim in SKILL (Read 6028 times)
adesign
Community Member
Offline
Posts: 73
String trim in SKILL
Jan 23
rd
, 2007, 2:47am
Could you please let me know if there is any way to trim a string in SKILL?
e.g.
Given string is ABCDEFG, MNOPEFG, IJKLEFG, WXYZEFG
I want ABCD, MNOP, IJKL, WXYZ and trim out EFG from the above.
Any suggestions...............
Back to top
IP Logged
Geoffrey_Coram
Senior Fellow
Offline
Posts: 1999
Massachusetts, USA
Re: String trim in SKILL
Reply #1 -
Jan 23
rd
, 2007, 6:12am
The hard way would be to use parseString and buildString, ie
result = buildString( parseString( "MNOPEFG", "EFG"))
Back to top
If at first you do succeed, STOP, raise your standards, and stop wasting your time.
IP Logged
bernd
Senior Member
Offline
Posts: 229
Munich/Germany
Re: String trim in SKILL
Reply #2 -
Jan 23
rd
, 2007, 9:21am
If you're sure that the string have always this character index
1234567
ABCDEFG
12345678
MNOPEFG
you can also use
substring( "MNOPEFG" 1 4 )
Bernd
Back to top
Just another lonesome cad guy
IP Logged
bernd
Senior Member
Offline
Posts: 229
Munich/Germany
Re: String trim in SKILL
Reply #3 -
Jan 23
rd
, 2007, 9:30am
Or very blown up, if you know that "EFG" were always the 3 last characters.
t_myString = "MNOPEFG"
t_result = substring( t_myString 1 length( parseString( t_myString "" ) ) - 3 )
Back to top
Just another lonesome cad guy
IP Logged
adesign
Community Member
Offline
Posts: 73
Re: String trim in SKILL
Reply #4 -
Jan 23
rd
, 2007, 11:22pm
Thank you all for the help!!
Back to top
IP Logged
adesign
Community Member
Offline
Posts: 73
Re: String trim in SKILL
Reply #5 -
Jan 24
th
, 2007, 2:22am
Here is one more improved version:
rexCompile("EFG$") ; pattern meaning EFG at end of string ($ means end of string)
rexReplace("ABCDEFG" "" 1) ; replace first occurrence of pattern with blank.
Regards,
Back to top
IP Logged
Andrew Beckett
Senior Fellow
Offline
Life, don't talk to
me about Life...
Posts: 1742
Bracknell, UK
Re: String trim in SKILL
Reply #6 -
Jan 24
th
, 2007, 2:16pm
Aw, you could have credited me ;)
Your last append looks remarkably like
http://www.cdnusers.org/Forums/tabid/52/view/topic/postid/3057/forumid/62/tpage/...
...
(I don't mind really, honest)
Andrew.
Back to top
IP Logged
adesign
Community Member
Offline
Posts: 73
Re: String trim in SKILL
Reply #7 -
Jan 24
th
, 2007, 10:21pm
Yes Andrew,
It is taken from there only!!!
Back to top
IP Logged
Pages: 1
‹
Previous topic
|
Next topic
›
Forum Jump »
» 10 most recent Posts
» 10 most recent Topics
Design
- RF Design
- Analog Design
- Mixed-Signal Design
- High-Speed I/O Design
- High-Power Design
- Mixed-Technology Design
Analog Verification
- Analog Functional Verification
- Analog Performance Verification
Measurements
- RF Measurements
- Phase Noise and Jitter Measurements
- Other Measurements
Modeling
- Semiconductor Devices
- Passive Devices
- Behavioral Models
- Transmission Lines and Other Distributed Devices
Design Languages
- Verilog-AMS
- VHDL-AMS
Simulators
»» Circuit Simulators
- RF Simulators
- AMS Simulators
- Timing Simulators
- System Simulators
- Logic Simulators
Other CAD Tools
- Entry Tools
- Physical Verification, Extraction and Analysis
- Unmet Needs in Analog CAD
General
- Tech Talk
- News
- Comments and Suggestions
- Opportunities
« Home
‹ Board
The Designer's Guide Community Forum
» Powered by
YaBB 2.2.2
!
YaBB
© 2000-2008. All Rights Reserved.
Copyright 2002-2024
Designer’s Guide Consulting, Inc.
Designer’s Guide
® is a registered trademark of
Designer’s Guide Consulting, Inc.
All rights reserved.
Send comments or questions to
editor@designers-guide.org
. Consider
submitting
a paper or model.