[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Get string from middle of phrase

Posted on 2011-09-20
4
Medium Priority
?
204 Views
Last Modified: 2012-05-12
What would be the most efficient way to get rid of the leading and training characters in the following string

FORM_FrmTestForm.txt

That is, get rid of the FORM_ and traling .txt to leave only FrmTestForm
0
Comment
Question by:ssmith94015
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 1400 total points
ID: 36568017
If the string ALWAYS has a underscore and period, AND the period always comes after the underscore...

Left(Mid(SomeString, InStr(1, SomeString, "_") + 1), InStr(1, Mid(SomeString, InStr(1, SomeString, "_") + 1), ".") - 1)
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 600 total points
ID: 36568019


try this

Dim x
x = "FORM_FrmTestForm.txt"
x = Mid(x, InStr(x, "_") + 1)
x = Left(x, Len(x) - 4)


that will give you   "FrmTestForm"
0
 

Author Comment

by:ssmith94015
ID: 36568043
Let me try both and be right back.
0
 

Author Closing Comment

by:ssmith94015
ID: 36568095
Both worked, however I went with the one-line version in this procedure.  This scenario always has the first five and last three but I do have another process that will have variable strings.   Thank you both.

Sandra
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question