[Question]
  [
(heavily inspired by [Element of string at specified index](https://codegolf.stackexchange.com/q/120375/42545))
Given a string `s` and an integer `n` representing an index in `s`, output `s` with the character at the `n`-th position removed.
0-indexing and 1-indexing are allowed.
* For 0-indexing, `n` will be non-negative and less than the length of `s`.
* For 1-indexing, `n` will be positive and less than or equal to the length of `s`.
`s` will consist of printable ASCII characters only (`\x20-\x7E`, or  through `~`).
Any reasonable input/output is permitted. [Standard loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) apply.
Testcases (0-indexed):
```
n s        output
0 "abcde"  "bcde"
1 "abcde"  "acde"
2 "a != b" "a = b"
3 "+-*/"   "+-*"
4 "1234.5" "12345"
3 "314151" "31451"
```
Testcases (1-indexed):
```
n s        output
1 "abcde"  "bcde"
2 "abcde"  "acde"
3 "a != b" "a = b"
4 "+-*/"   "+-*"
5 "1234.5" "12345"
4 "314151" "31451"
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer in bytes wins.
  
[Answer]
# C#, ~~20~~ 19 bytes
```
s=>n=>s.Remove(n,1)
```
[Answer]
## [Alice](https://github.com/m-ender/alice), ~~13~~ 12 bytes
*Thanks to Leo for saving 1 byte.*
```
/oI\!e]&
@ q
```
[Try it online!](https://tio.run/nexus/alice#@6@f7xmjmBqrxuWgUPj/f6KCoq1CEpcRAA "Alice – TIO Nexus")
First line of the input is the string, second line is the 0-based index.
### Explanation
```
/    Reflect to SE. Switch to Ordinal. While in Ordinal mode, the IP bounces
     diagonally up and down through the code.
I    Read the first line of input (the string).
!    Store the string on the tape, which writes the characters' code points to 
     consecutive cells (the tape is initialised to all -1s).
]    Move the tape head right. This moves it by an entire string, i.e. to the
     cell after the -1 that terminates the current string.
     The IP bounces off the bottom right corner and turns around.
]    Move the tape head right by another cell.
!    Store an implicit empty string on the tape, does nothing. It's actually
     important that we moved the tape head before this, because otherwise it
     would override the first input code point with a -1.
I    Read the second line of input (the index) as a string.
/    Reflect to W. Switch to Cardinal.
     The IP wraps around to the last column.
&]   Implicitly convert the first input to the integer value it contains
     (the index) and move the tape head that many cells to the right, i.e.
     onto the character we want to delete. Note that Ordinal and Cardinal mode
     have two independent tape heads on the same tape, so the Cardinal tape
     head is still on the first cell of the string input before we do this.
e!   Store a -1 in the cell we want to delete.
\    Reflect to SW. Switch to Ordinal.
q    Push the entire tape contents as a single string. This basically takes
     all cells which hold valid code points from left to right on the tape 
     and concatenates the corresponding characters into a single string. Since
     we wrote a -1 (which is not a valid code point) over the target character,
     this will simply push the entire input string without that character.
o    Output the result.
@    Terminate the program.
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 2 bytes
```
jV
```
[Try it online!](https://tio.run/nexus/japt#@58V9v@/krGhiaGpoZKCMQA "Japt – TIO Nexus")
[Answer]
## K (Kona), 1 byte
```
_
```
Gotta love builtins. 0-based indexing. Usage:
```
k)"abcdef" _ 3
"abcef"
```
[Answer]
# [Haskell](https://www.haskell.org/documentation), ~~28~~ 24 Bytes
-4 byte thanks to Laikoni, this version is 1-indexed.
```
s#n=take(n-1)s++drop n s
```
Old answer:
```
f(s:t)0=t;f(s:t)n=s:f t(n-1)
```
A simple recursive function that takes the value, it's 0-indexed.
My first time code-golfing so maybe it's not the optimal solution. Oh well.
[Answer]
# [CJam](https://sourceforge.net/p/cjam), 4 bytes
```
q~Lt
```
[Try it online!](https://tio.run/nexus/cjam#@19Y51Py/7@xgpKxoYmhqaESAA "CJam – TIO Nexus")
### Explanation
```
q~    e# Read and eval input (push the string and number to the stack).
  Lt  e# Set the nth element of the string to the empty string.
```
[Answer]
# [V](https://github.com/DJMcMayhem/V), 3 bytes
```
À|x
```
[Try it online!](https://tio.run/nexus/v#@3@4oabi///EpOSU1P9GAA "V – TIO Nexus")
This uses 1-indexing.
[Answer]
## Mathematica, 18 bytes
1-indexed
```
#2~StringDrop~{#}&
```
input
> 
> [1, "abcde"]
> 
> 
> 
thanks Martin Ender
[Answer]
# [MATL](https://github.com/lmendo/MATL), 3 bytes
```
&)&
```
Uses 1-based indexing.
[Try it online!](https://tio.run/nexus/matl#@6@mqfb/v3piUnJKqjqXEQA "MATL – TIO Nexus") Or [verify all test cases](https://tio.run/nexus/matl#S/ivpqn2P8KlIuS/emJSckqqOpchF4xlBGQpKNoqJKlzGXOpa@tq6atzmXCpGxoZm@iZqnOZcqkbG5oYmhoCRQE).
### Explanation
```
&    % Specify secondary default number of inputs/outputs for next function
)    % Implicitly input string and number. Index: with & it pushes the char
     % defined by the index and the rest of the string
&    % Specify secondary default number of inputs/outputs for next function
     % Implicitly display (XD): with & it only displays the top of the stack
```
In the modified version with all the test cases, the code is within an infinite loop ``...T` until no input is found. At the end of each iteration the display function (`XD`) is explicitly called, and the stack is cleared (`x`) to ready it for the next iteration.
[Answer]
# Vim, 7 bytes
```
jDk@"|x
```
**How it works:**
It expects two lines; one with the string and one with the number.
1. Go to line two, copy the number into register
2. Go to first line and then go to column in the register with @"|
3. Delete the character under the cursor
[Answer]
# Java 8, 39 bytes
```
s->n->s.substring(0,n)+s.substring(n+1)
```
[Try it here.](https://tio.run/nexus/java-openjdk#lY29jsIwEIT7PMVCFZPEh0moOFIiUVBRnq5wnIB8cjZWvEZCiGfPhb8IXZWrdmdmv1ld26Yl@JEnyT1pww8eFekG@ea5rAJlpHOwkxovAYD1hdEKHEnqx6nRJdR9FO6p1Xj8@gbJbmcAr4LPRxIPeotUHas2fvh5DgrWnUtyTHLHnS/c3Q/nMbLo3cBIsO7WvLr378@Oqpo3nrjtczIYKi6tNedwKgtVVlP2lHPG/ouIUQhM1lAMzGIMEyWzj4FIxxBikWZ8OTDZGCYVmViKv3@uwbX7BQ)
# Java 7, 67 bytes
```
String c(int n,String s){return s.substring(0,n)+s.substring(n+1);}
```
[Try it here.](https://tio.run/nexus/java-openjdk#jc29DoIwEMDxnac4O7VSq@VjIj6CE6NxaAsxTaAQ2poYwrNjVQYX0fHufvmfaoS1cBojAOuE0wrm0g3aXEFhbRwYuoyWjEPt/GDAMuulfW3xgRoSfy5MzEkxzQC9l02oLdFbpytohTb4nTtfQJDnU4Dybl3dss471oeTawxWoYuEVFWNCCm@K/6XSoKCzRHkOkspinfb/TrKKOJJmrH8ZyvlGc/5wqZomh8)
[Answer]
# [Ruby](https://www.ruby-lang.org/), 16 bytes
```
->n,s{s[n]='';s}
```
[Try it online!](https://tio.run/nexus/ruby#S7T9r2uXp1NcXRydF2urrm5dXPs/z9aAq9hWKTEpOSVViaugtKRYITEaqCb2PwA "Ruby – TIO Nexus")
[Answer]
# GCC c function, 25
1-based indexing.
```
f(n,s){strcpy(s-1,s+=n);}
```
Plenty of undefined behavior here so [watch out for stray velociraptors](https://xkcd.com/292/):
* The [`strcpy()` man page](http://pubs.opengroup.org/onlinepubs/9699919799/functions/strcpy.html) says *If copying takes place between objects that overlap, the behavior is undefined*. Here there clearly is overlap of the *src* and *dest* strings, but it seems to work, so either glibc is more careful or I got lucky.
* The answer is reliant on the fact that the `s+=n` happens before the `s-1`. The [c](/questions/tagged/c "show questions tagged 'c'") standard gives no such guarantees, and in fact calls this out as undefined behaviour. Again, it seems to work as required with the gcc compiler on x86\_64 Linux.
[Try it online](https://tio.run/nexus/c-gcc#jZHRboMwDEXf@QoPqVICKS0Fnli@pPBAIXSRthTFYdKG@PYulI7C1qmLosS2zrWVm3NNFEPaodFl80FwHTL0uaJpf5bKwFshFRmCQh9LBuVLocHzbPJOoXPALitsSwNGoCkLFNfqsAaZSqd01OJY6CcB7nPgM1UHgeIhgwC5bV21DXGLQ1kJl0LPltTuX1S0pOCJw@EOFi8wf@1t7kDJAgp3URwkD3tFYRwm4YCNTx8dGNyRY3g56pMGIq0V2xQkPAPKT3GqyWQThc2v2n6bU0v7Pp0Z2Gjbuiau4quKAfLMXWHmMrD7JpR5oH7kSG9/NZ/xAP0epwW2r@Y6LVPuH5LeuVxamFYr@1and85f).
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
Ṭœp
```
A full program taking the (1-based) index and the string (in that order) and printing the result.
As a dyadic function it returns a list of the two parts.
In fact the index may be a list of **n** indices, in which case it returns a list of the **n-1** parts.
**[Try it online!](https://tio.run/nexus/jelly#@/9w55qjkwv@//9v@b84Pze1JCMzL10hv0ghvyQjtQgA "Jelly – TIO Nexus")**, or see a [test suite](https://tio.run/nexus/jelly#@/9w55qjkwv@H16uFPn/f7ShjpGOsY6JjqmOSez/aKXEpOSUVCUdBK2gaKuQBGRo62rpAylDI2MTPVMgw9jQxNDUUCkWAA).
### How?
```
Ṭœp - Main link: number i, string s                   e.g. "fish 'n chips", 6
Ṭ   - untruth - get a list with 1s at the indexes of i      000001 <-- i.e. [0,0,0,0,0,1]
 œp - partition s at truthy indexes without borders       ["fish ","n chips"]
    - implicit print                                        fish n chips
```
As an example of using multiple indexes:
```
      "fish and chips", [6,8]
Ṭ      00000101 <- i.e. [0,0,0,0,0,1,0,1]
 œp  ["fish ","n"," chips"] 
       fish n chips
```
[Answer]
# [Haskell](https://www.haskell.org/), 15 bytes
This requires the recently released GHC 8.4.1 (or higher). [Now](https://prime.haskell.org/wiki/Libraries/Proposals/SemigroupMonoid) `<>`, as a function on Semigroups, is in Prelude. It is particularly useful on the function Semigroup
```
take<>drop.succ
```
[Try it online!](https://tio.run/##bco7EoIwEADQnlOsGQvQAQ0JHVBZ2tHaLCFghk92Qri@0Va0ffOeuI56moKZyToPN/SYNXo2g7MbxXFZJ0nUV4/gcdRl3TlL2bopFWY0C1TQ2QiANt94d1@OPVyBYas6zb6Z/@f8w3CooN25AHZOT5edSmA8FzIrfrfgkhechZfqJxzWkCqiNw "Haskell – Try It Online")  
Since tio is using an older bersion of GHC, I've imported `<>` in the header.
[Answer]
# R, 40 bytes
Just goes to show the variety of ways, none of which particularly compact, you can fiddle with strings in R.
```
function(s,n)intToUtf8(utf8ToInt(s)[-n])
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 6 bytes
```
vNÊiy?
```
[Try it online!](https://tio.run/nexus/05ab1e#@1/md7grs9L@/39DI2MTPVMuEwA "05AB1E – TIO Nexus")
**Explanation**
```
v       # for each element, index (y,N) in input1
 NÊi    # if N is not equal to input2
    y?  # print y
```
[Answer]
# Pyth, 3 bytes
```
.DE
```
[Try it here.](http://pyth.herokuapp.com/?code=.DE&test_suite=1&test_suite_input=0%0A%22abcde%22%0A1%0A%22abcde%22%0A2%0A%22a+%21%3D+b%22%0A3%0A%22%2B-%2a%2F%22%0A4%0A%221234.5%22%0A3%0A%22314151%22&debug=0&input_size=2)
Takes index first.
[Answer]
# JS (ES6), ~~41~~ ~~32~~ 31 bytes
```
y=>i=>y.slice(0,i++)+y.slice(i)
```
Based on [this](https://stackoverflow.com/a/9933072/6560716). Takes input through currying, first is string, second is index.
-9 thanks to @JohanKarlsson 
-1 thanks to @ETHproductions
[Answer]
## vim, ~~10~~ 7
```
DgJ@"|x
```
Takes 1-indexed input in the following format:
```
2
abcde
```
```
D      delete the number on the first line into register "
gJ     remove the newline while preserving whitespace on line 2
@"     run the " register as a macro - input is used as a count for...
|      the "go to nth column" command
x      delete the character at the cursor
```
Thanks to [@DJMcMayhem](https://codegolf.stackexchange.com/users/31716/djmcmayhem) for 3 bytes!
[Answer]
# [brainfuck](https://github.com/TryItOnline/tio-transpilers), 14 bytes
```
,[>,.<-],,[.,]
```
[Try it online!](https://tio.run/nexus/brainfuck#@68TbaejZ6Mbq6MTracT@/8/U6KCoq1CEgA "brainfuck – TIO Nexus")
Reads zero-based one-byte index immediately followed by the string.
[Answer]
# Java 8, ~~45~~ 41 bytes
```
s->n->new StringBuffer(s).deleteCharAt(n)
```
*Saved 4 bytes thanks to @OlivierGrégoire*
My first code golf answer in something other than C#, even if it isn't the shortest for Java yet.
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), 5 bytes
Zero-indexed. Takes index `n` as left argument and string `s` as right argument.
```
↑,1↓↓
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R24RHbRN1DB@1TQai//8NFNIU1BOTklNS1bkMkdhGYLaCoq1CkjqXMYijraulr85lAmIaGhmb6JlCxY0NTQxNDdUB "APL (Dyalog Unicode) – Try It Online")
`↑` `n` characters from `s`
`,` followed by
`1↓` one character dropped from
`↓` `n` characters dropped from `s`
[Answer]
# [Python 3](https://docs.python.org/3/), 24 bytes
```
lambda n,a:a[:n]+a[n+1:]
```
[Try it online!](https://tio.run/nexus/python3#S7ON@Z@TmJuUkqiQp5NolRhtlRernRidp21oFfu/oCgzr0QjTcNARykxKTklVUlTkwsmZohFzAgopqBoq5CELGiso6Stq6WPLGSio2RoZGyiZ4qmztjQxNDUECj4HwA "Python 3 – TIO Nexus")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 4 bytes
```
Jḟị³
```
[Try it online!](https://tio.run/nexus/jelly#@@/1cMf8h7u7D23@//9/ooKirULSf2MA "Jelly – TIO Nexus")
**Explanation**
```
Jḟị³
J    - all indices of the input string
 ḟ   - except for the input index
  ị  - return the elements at those indices
   ³ - of the input string
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 5 bytes
```
ā²ÊÏJ
```
[Try it online!](https://tio.run/nexus/05ab1e#@3@k8dCmw12H@73@/zc2NDE0NeQyAQA "05AB1E – TIO Nexus")
```
ā     # push range(1, len(input string) + 1)
 ²Ê   # Check each for != to input index
   Ï  # Keep characters from input where this array is 1
    J # Join
```
[Answer]
# PHP, 42 Bytes
0 indexed
```
<?=substr_replace($argv[1],"",$argv[2],1);
```
[Try it online!](https://tio.run/nexus/php#@29jb1tcmlRcUhRflFqQk5icqqGSWJReFm0Yq6OkpANhG8XqGGpa////P1FB0VYh6b8RAA "PHP – TIO Nexus")
[Answer]
# [Befunge-98](https://github.com/catseye/FBBI), ~~35~~ ~~27~~ 25 bytes
*-4 bytes thanks to @eush77*
```
&#;1-:!#v_~,;
_@#:~;#~<;,
```
[Try it online!](https://tio.run/nexus/befunge-98#@6@mbG2oa6WoXBZfp2PNFe@gbFVnrVxnY63z/79JooKirUISAwA "Befunge-98 – TIO Nexus")
1-indexed, note that the input has a trailing null-byte.
[Answer]
# **PHP, 41 bytes, 35 bytes excluding ?php**
```
<?php $argv[1][$argv[2]]='';echo$argv[1];
```
0-indexed
[TIO](https://tio.run/nexus/php#@29jX5BRoKCSWJReFm0YGw1hGMXG2qqrW6cmZ@TDZKz///@fWlySn5eZ@N8IAA "TIO")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~3~~ 2 bytes
```
jV
```
[Try it online!](https://tio.run/##y0osKPn/Pyvs/3@lxKTklNQ0JR0FIwA "Japt – Try It Online")
]