Solved

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

Posted on 2016-08-24
2
46 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
[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 Comments
 
LVL 13

Accepted Solution

by:
Dustin Saunders earned 500 total points
ID: 41769128
Just replace _Front with nothing.

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

Open in new window

0
 
LVL 34

Expert Comment

by:ste5an
ID: 41769134
string file_tif = "2016XXXXXXXXXX_Front.TIF";
file_tif = "2016XXXXXXXXXX.TIF";

Open in new window

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

718 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