Remove a Character from a String at Specified Position
Python Code:
1 2 3 4 5 6 7 8 9 10 | plants = "Broadleaf. False Boxwood. Brown Betty." without2ndCharacter = plants[:1] + plants[1+1:] without5thCharacter = plants[:4] + plants[4+1:] print("string remove second character: " + without2ndCharacter) print("string remove 5th character: " + without5thCharacter) |
Output: