How can I unwrap a string in Xcode to fix error? : I'm a beginner in iOS programming, so please understand that my question will probably sound dumb for you. I am trying to make an app that the user selects an option from a tableview cell, but I get a "Value of optional type 'String?' must be unwrapped to a value of type 'String'" error. I get the error on the 5th line and line 16, both about "unwrapping an optional type".

I've tried adding a !, and searching on the internet, but I couldn't find any information that could help me fix the error.

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as? DataTableViewCell
        cell?.img.image = UIImage(named: arr[indexPath.row]["name"!])
        cell?.lbl.text = arr[indexPath.row]["name"]
        cell?.lbl2.text = arr[indexPath.row]["subject"]
        cell?.lbl3.text = arr[indexPath.row]["grade"]
        return cell!
    }
    
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let vc = storyboard?.instantiateViewController(withIdentifier: "DetailViewController") as? DetailViewController
        vc?.str = arr[indexPath.row]["name"]
        navigationController?.pushViewController(vc!, animated: true)
        
    }

I expect the program to run without errors.

