Solved

How to replace a fixed position value with another another value in C#?

Posted on 2016-08-24
2
28 Views
Last Modified: 2016-08-24
I am creating a C# application using .Net Framework 4.0.

I have a variable titled "file_tif" that has a value, for example, of  (X represents a number)    "2016XXXXXXXXXX_Front.TIF"
How would you replace the variable's value with                                                                            "2016XXXXXXXXXX.TIF"
0
Comment
Question by:zimmer9
2 Comments
 
LVL 12

Accepted Solution

by:
Dustin Saunders earned 500 total points
Comment Utility
Just replace _Front with nothing.

string input = "2016XXXXXXXXXX_Front.TIF";
            input = input.Replace("_Front", string.Empty);

Open in new window

0
 
LVL 32

Expert Comment

by:Stefan Hoffmann
Comment Utility
string file_tif = "2016XXXXXXXXXX_Front.TIF";
file_tif = "2016XXXXXXXXXX.TIF";

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now