Hi everyone new to MVC and I need to trim some %20's off of my data so it will display correctly. At the moment my CRUD displays the index correctly and it is able to edit user created records but when I try to edit a record that was from the legacy database it doesn't work and throws an error that the resource cannot be found. I looked closer at the URL for the legacy database records and saw that following most of the database records was %20%20%20%20%20. This told me that the database records were being followed by extra white space since that is what %20 meaning is. I did some research and found that the Trim function could get rid of the extraneous characters for me. I just don't understand how to use the trim function in my specific situation. 

I think that I need to use the function in my Controller under my Edit ActionResult but when I tried it in a few different spots I had no luck. I thought that I understood how this function works but with no change in result for the better I am stuck. I hope that this explains the problem well enough, below I have posted the code for my controller with my CRUD methods in it but if you need me to post any other classes let me know. 

You may notice that I have left a trim method in my edit method, this was my attempt at solving the problem and can easily be removed if I am completely wrong, and since it didn't work I believe I am! Thanks for your help if you need my edit class just ask I will be checking back often! And for anyone reading this to help them solve the same problem I will be sure and post the solution once it has been solved! 

PaController
------------

```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DBFirstMVC.Models;
using System.Data;

namespace DBFirstMVC.Controllers
{
    public class PaController : Controller
    {
        PaEntities db = new PaEntities();
        //
        // GET: /Pa/

        public ActionResult Index()
        {
            using (var db = new PaEntities())
            {
                return View(db.iamp_mapping.ToList());
            }
        }

        //
        // GET: /Pa/Details/5

        public ActionResult Details(int id)
        {
            return View();
        }

        //
        // GET: /Pa/Create

        public ActionResult Create()
        {
            return View();
        } 

        //
        // POST: /Pa/Create

        [HttpPost]
        public ActionResult Create(iamp_mapping IAMP)
        {
            try
            {
                using (var db = new PaEntities())
                {
                    db.iamp_mapping.Add(IAMP);
                    db.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /Pa/Edit/5

        public ActionResult Edit(string id)
        {

            using (var db = new PaEntities())

            {
                string trimmedID = id.Trim();
                return View(db.iamp_mapping.Find(trimmedID));
            }
        }

        //
        // POST: /Pa/Edit/5

        [HttpPost]
        public ActionResult Edit(string id, iamp_mapping IAMP)
        {
            try
            {
                using (var db = new PaEntities())
                {
                    db.Entry(IAMP).State = EntityState.Modified;
                    db.SaveChanges();
                    return RedirectToAction("");
                }
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /Pa/Delete/5

        public ActionResult Delete(string id)
        {
            using (var db = new PaEntities())
            {

                return View(db.iamp_mapping.Find(id));
            }
        }

        //
        // POST: /Pa/Delete/5

        [HttpPost]
        public ActionResult Delete(string id, iamp_mapping IAMP)
        {
            try
            {
                using (var db = new PaEntities())
                {
                    db.Entry(IAMP).State = EntityState.Deleted;
                    db.SaveChanges();
                    return RedirectToAction("");
                }

            }
            catch
            {
                return View();
            }
        }
    }
}

```