473,414 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

string mod.

hello,
Can someone show me how I can make this to happen!?

1. This is my string: small_testpic.jpg
2. I need the output: testpic.jpg

Thanks // Nils
Apr 12 '06 #1
3 1171

news wrote:
hello,
Can someone show me how I can make this to happen!?

1. This is my string: small_testpic.jpg
2. I need the output: testpic.jpg

Thanks // Nils


Same as the last time. Use the replace() function. If you found my
suggestion relating to your previous post (http://tinyurl.com/z6f5g)
worked, but you didn't understand why, then you should have a look at
the VBScript Replace function documentation at msdn, or any one of the
countless tutorials on offer, but in the shell of a nut, it works like
this:

output =
replace(original_string,"part_to_replace","what_to _replace_it_with")

--
Mike Brind

Apr 12 '06 #2
news wrote on 12 apr 2006 in microsoft.public.inetserver.asp.general:
hello,
Can someone show me how I can make this to happen!?

1. This is my string: small_testpic.jpg
2. I need the output: testpic.jpg

Thanks // Nils


ASP not being a computer language but a platform,
you must choose one.

using jscript:

var t = 'small_testpic.jpg';
var t2 = t.replace(/small_/,'');

or

var t = 'small_testpic.jpg';
var t2 = t.substr(6);
using vbscript:

dim t,t2
t = "small_testpic.jpg"
t2 = replace(t,"small_","")

or:

dim t,t2
t = "small_testpic.jpg"
t2 = mid(t,7)

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Apr 12 '06 #3
What rule are you applying to get that output? There are many ways to get
that result from that exact circumstance:

s = "small_testpic.jpg"

r = Right(s, 11)

r = Replace(s, "small_", "")

r = Split(s, "_")(1)

r = Right(s, Len(s) - 6)
What's the logic you're using to get that result? The last 11 characters?
The result after removing any instance of the literal string "small_?"
Anything that appears after the first "_" and between the next, if it
exists? The result after removing the first six characters, whatever they
may be?

Ray at work


"news" <ne**@sitebiz.se> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
hello,
Can someone show me how I can make this to happen!?

1. This is my string: small_testpic.jpg
2. I need the output: testpic.jpg

Thanks // Nils

Apr 12 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Krakatioison | last post by:
My sites navigation is like this: http://www.newsbackup.com/index.php?n=000000000040900000 , depending on the variable "n" (which is always a number), it will take me anywhere on the site......
5
by: Stu Cazzo | last post by:
I have the following: String myStringArray; String myString = "98 99 100"; I want to split up myString and put it into myStringArray. If I use this: myStringArray = myString.split(" "); it...
9
by: John F Dutcher | last post by:
I use code like the following to retrieve fields from a form: recd = recd.append(string.ljust(form.getfirst("lname",' '),15)) recd.append(string.ljust(form.getfirst("fname",' '),15)) etc.,...
10
by: Angus Leeming | last post by:
Hello, Could someone explain to me why the Standard conveners chose to typedef std::string rather than derive it from std::basic_string<char, ...>? The result of course is that it is...
2
by: Andrew | last post by:
I have written two classes : a String Class based on the book " C++ in 21 days " and a GenericIpClass listed below : file GenericStringClass.h // Generic String class
29
by: zoro | last post by:
Hi, I am new to C#, coming from Delphi. In Delphi, I am using a 3rd party string handling library that includes some very useful string functions, in particular I'm interested in BEFORE (return...
2
by: Badass Scotsman | last post by:
Hello, Using VB and ASP,NET I would like to be able to search a STRING for a smaller STRING within, based on the characters which appear before and after. For example: String1 = " That was...
15
by: morleyc | last post by:
Hi, i would like to remove a number of characters from my string (\t \r \n which are throughout the string), i know regex can do this but i have no idea how. Any pointers much appreciated. Chris
11
by: ramu | last post by:
Hi, Suppose I have a string like this: "I have a string \"and a inner string\\\" I want to remove space in this string but not in the inner string" In the above string I have to remove...
8
by: drjay1627 | last post by:
hello, This is my 1st post here! *welcome drjay* Thanks! I look answering questions and getting answers to other! Now that we got that out of the way. I'm trying to read in a string and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.