text:
Remove character at specified index
(heavily inspired by Element of string at specified index)
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 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, so shortest answer in bytes wins.

No one else answer, C# is winning... too late :(

Can we assume that the char at that idx appears only once?

@programmer5000 Last test case 3, 314151 -> 31451. I'd assume not.

@programmer5000 No. See the last test case.

Can we take n as a character code? Or must it be in decimal? (for languages like brainfuck, brain-flak, etc.)

@DJMcMayhem I think char-code input would be fine.

Maybe a leaderboard would be helpful, there are plenty of answers to search through already.

Are we allowed to modify string s in place, or do I have to actually return a new string?

@12Me21 I believe there was a meta post about this and the general consensus was that functions can modify their arguments in place. So if e.g. var s="string"; f(s,2); print(s); prints the proper result, then yes.

C#, 20 19 bytes
s=>n=>s.Remove(n,1)

Alice, 13 12 bytes
Thanks to Leo for saving 1 byte.
/oI\!e]&
@ q

Try it online!
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.

K (Kona), 1 byte
_

Gotta love builtins. 0-based indexing. Usage:
k)"abcdef" _ 3
"abcef"

Giving a whole new meaning to 'using the right tool for the job'.

Ha - you want to see right tool for the job? https://codegolf.stackexchange.com/a/121700/49493

I have discovered a way to do this with an even shorter program. Unfortunately, there is not enough room in this comment box to explain ;-)

Japt, 2 bytes
jV

Try it online!

Bah, you beat me to it by a minute!

Haskell, 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.

Welcome to PPCG!

Also you might be interested in the collection of tips for golfing in Haskell.

V, 3 bytes
À|x

Try it online!
This uses 1-indexing.

CJam, 4 bytes
q~Lt

Try it online!
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.

Mathematica, 18 bytes
1-indexed
#2~StringDrop~{#}&

input

[1, "abcde"]

thanks Martin Ender

In my opinion, "Any reasonable input/output is permitted" allows for the input to be taken like ["abcde", {1}], in which case StringDrop alone does the trick. What do you think? (You might want to explicitly mention that it's 1-indexed as well.) I'm always happy to see people posting Mathematica answers :)

MATL, 3 bytes
&)&

Uses 1-based indexing.
Try it online! Or verify all test cases.
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.

I like the idea of generic command modifiers, they might be useful in other golfing languages.

@ETHproductions If you need a name, I call them meta-functions, as they modify functions

@LuisMendo I think the formal name would be operators, a la mathematical operators (aka higher-order functions).

Ruby, 16 bytes
->n,s{s[n]='';s}

Try it online!

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:

The strcpy() man page 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 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.

In a stack-based ABI, such as x86, strcpy's arguments need to be pushed in right-to-left order, which would explain the behaviour, but you said you were using x86_64 which uses registers... maybe the compiler decided to golf the generated code and decided that computing s+=n first was golfier!

I love it when C answers go "this has no official reason to work, but it does anyway, so... eh."

Holy crap. This blows mine out of the water. Very impressive!

@Quentin That's one of the fun things about [tag:code-golf] - you are allowed - encouraged even - to write the most awful, unsafe code that would normally be a firing offence ;-)

I'd love to know the reason for the downvote...

Jelly, 3 bytes
Ṭœ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!, or see a test suite.
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

Vim, 7 bytes
jDk@"|x

How it works:
It expects two lines; one with the string and one with the number.

Go to line two, copy the number into register
Go to first line and then go to column in the register with @"|
Delete the character under the cursor

Another fun solution that's almost identical is jD@"gox

Flagging -> Closing -> Duplicate of https://codegolf.stackexchange.com/a/121581/61563 :P kidding, but they are remarkably similar.

they are! Is there any prize for getting down to 7 characters first? :-P

Java 8, 39 bytes
s->n->s.substring(0,n)+s.substring(n+1)

Try it here.
Java 7, 67 bytes
String c(int n,String s){return s.substring(0,n)+s.substring(n+1);}

Try it here.

Assuming it works, a "built in" for 46 bytes s->n->new StringBuilder(s).deleteCharAt(n)+""; though it is longer.

@TheLethalCoder It indeed works. But it's indeed a bit longer. Oh, and always use StringBuffer instead of StringBuilder in codegolf. ;)

Ah nice trick on the buffer I used it in my answer :)

APL (Dyalog), 5 bytes
Zero-indexed. Takes index n as left argument and string s as right argument.
↑,1↓↓

Try it online!
↑ n characters from s
, followed by
1↓ one character dropped from
↓ n characters dropped from s

Haskell, 15 bytes
This requires the recently released GHC 8.4.1 (or higher). Now <>, as a function on Semigroups, is in Prelude. It is particularly useful on the function Semigroup
take<>drop.succ

Try it online!
Since tio is using an older bersion of GHC, I've imported <> in the header.

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])

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.

You don't need the final ; in lambda (-1 bytes). 2. In my eyes, you don't need to return a String. I think that returning the StringBuffer without the +""would be perfectly valid (-3 bytes). Example? BigInteger is a representation of an unbounded int, in this case StringBuffer/StringBuilder are representations of mutable Strings.

@OlivierGrégoire Thanks :) I've never actually used Java before so all improvements are welcome

brainfuck, 14 bytes
,[>,.<-],,[.,]

Try it online!
Reads zero-based one-byte index immediately followed by the string.

Aw, you beat me to it :/ I had the exact same solution. +1

JS (ES6), 41 32 31 bytes
y=>i=>y.slice(0,i++)+y.slice(i)

Based on this. Takes input through currying, first is string, second is index.
-9 thanks to @JohanKarlsson
-1 thanks to @ETHproductions

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 for 3 bytes!

05AB1E, 6 bytes
vNÊiy?

Try it online!
Explanation
v       # for each element, index (y,N) in input1
 NÊi    # if N is not equal to input2
    y?  # print y

Pyth, 3 bytes
.DE

Try it here.
Takes index first.

Befunge-98, 35 27 25 bytes
-4 bytes thanks to @eush77
&#;1-:!#v_~,;
_@#:~;#~<;,

Try it online!
1-indexed, note that the input has a trailing null-byte.

Python 3, 24 bytes
lambda n,a:a[:n]+a[n+1:]

Try it online!

Dam you beat me to it!

I think, that this is valid for python 2 too

Jelly, 4 bytes
Jḟị³

Try it online!
Explanation
Jḟị³
J    - all indices of the input string
 ḟ   - except for the input index
  ị  - return the elements at those indices
   ³ - of the input string

05AB1E, 5 bytes
ā²ÊÏJ

Try it online!
ā     # push range(1, len(input string) + 1)
 ²Ê   # Check each for != to input index
   Ï  # Keep characters from input where this array is 1
    J # Join

Japt, 3 2 bytes
jV

Try it online!

You don't need the 1

Thanks a lot. Not sure how I missed that...

PHP, 42 Bytes
0 indexed

<?=substr_replace($argv[1],"",$argv[2],1);

Try it online!

PHP, 41 bytes, 35 bytes excluding ?php
<?php $argv[1][$argv[2]]='';echo$argv[1];

0-indexed
TIO

I'm actually really surprised this works; is the [$argv[2]] index implicitly creating a range? Also, IIRC you can leave the <?php  off, because the PHP interpreter has a mode which doesn't need it, and because we don't normally penalise for that sort of indication in a file of what the language is.

@ais523 Basically yes. From docs: "Characters within strings may be accessed and modified by specifying the zero-based offset of the desired character after the string using square array brackets, as in $str[42]. Think of a string as an array of characters for this purpose." http://php.net/manual/en/language.types.string.php

R, 48 47 bytes
(1 byte saved through use of el() thanks to Giuseppe)
function(s,n)cat(el(strsplit(s,""))[-n],sep="")

Split the string into its individual characters, remove the nth and then concatenate again.
There may well be a better solution, strsplit() is quite unwieldy as it returns a list.

won't work on TIO: pryr::f([function body]) saves a few bytes and using el(strsplit(s,"")) saves a byte but also doesn't work on TIO for some reason.

@Giuseppe Thanks! I would feel a bit dirty making use of pryr::f since surely it should be preceded by install.packages("pryr") but maybe that's me being too precious!

function(s,n)intToUtf8(utf8ToInt(s)[-n]) for 40 bytes.

@J.Doe good spot! That's a very different approach so you should post it as your own answer.

Another sub-47 is function(s,n)sub(sub(0,n,"(.{0})."),"\\1",s) for 44.

Cubically, 46 56 34 bytes
R3D1R1$:7~?6{(~@7-0)6}~(~-0=7&6@7)

(0-based index)
Try it online! You must change &6 to ?6& on  TIO due to a bug in the interpreter.
How it works
R3D1R1$:7~?6{(~@7-0)6}~(~-0=7&6@7)
R3D1R1                             Set the top face to 1
      $                            Get next numeric input
       :7                          Set notepad to input
         ~                         Read (skip) next character (space)
          ?6{        }             If notepad is nonzero
             (     )6              While notepad is nonzero
              ~@7                  Print next inputted character
                 -0                Subtract 1 from notepad
                      ~            Read (skip) next character
                       (         ) Loop indefinitely
                        ~          Get next character
                         -0=7&6    Exit program if input is -1 (EOF)
                               @7  Output the input

q, 6 1 byte
_

Test Cases
q)"abcde"_0
"bcde"
q)"abcde"_1
"acde"
q)"a != b"_2
"a = b"
etc.

why not just _? :) it's ok to swap the arguments, many answers already do that

I suppose you're right, it's built in functionality, thanks

Javascript (ES6), 48 bytes
x=>i=>x.substring(0,i-1)+x.substring(i,x.length)

Or this (55 bytes)
n=[],x=>i=>x.split``.forEach((_,i)=>i==x?0:n.push(_))

Just wanted to say, community downvoted this post because it was flagged as "low quality" (I think) and then I edited it, causing it to downvote. Welcome to the site!

You can save some bytes in the second one by replacing ("") with \`, and (x,i)withx=>i` in the first and second one.

Chip, 115 bytes
*Z~S
,x.z.
`@z\{Aa
,x.|*
`@z\{Bb
,x.|
`@z\{Cc
,x.|*
`@z\{Dd
,x.|
`@z\{Ee
,x.|*
`@z\{Ff
,x.|
`@z\{Gg
,x.|*
`@z\{H
 S

The first byte of input is a 0-based index, the remainder is the string to process: \x02abcde.
Try it online!
In this TIO, a newline character is the index, which means an index of 0x0a = 10.
Test cases!
These use hex input + printf to make it clearer what's happening.
How does it work?
*Z~S
This suppresses output on the first byte, because we don't want to print the index. That'd be silly.
Aa, Bb, Cc, etc.
These relay the input to the output for every byte, unless suppressed. Note that the h is missing, this is because we never need to output something with the high bit set.
,x.
`@z\{D

This is the real meat of it all. There are eight of these, one for each bit of the index (a one-byte index means that indexes are not able to be specified above 255). This reads in the index on the first cycle only with switches (\). The index bits have been flipped with an xor gate ({), which is almost negation. Then, for each character of the string, this value is incremented via some half-adders (@). When this value is incremented from 0xff to 0x00, it uses the carry from the high bit to suppress output (S) for that character, effectively removing it from the string.

J, 8 bytes
{.,1}.}.

Uses zero-based indexing.
Try it online!
Explanation
{.,1}.}.  Input: integer n (LHS), string s (RHS)
      }.  Drop the first n chars of s
   1}.    Drop one char from that
{.        Take the first n chars of s
  ,       Join them

Bash, 83 24 22 bytes
echo ${1::$2-1}${1:$2}

24 bytes answer given by Digital Trauma
-2 bytes, quotation marks not needed
My first GodeGolf answer, any feedback is apreciated

Welcome to PPCG!

How about echo "${1::$2-1}${1:$2}"?

@DigitalTrauma welp, i tried that and thought it didnt work because i was testing with 0 indexed

JavaScript (ES6), 39 34 33 bytes
n=>s=>s.replace(/./g,c=>n--?c:"")

5 6 bytes saved thanks to Arnauld.

PowerShell, 25 Bytes
3 Options, all the exact same bytecount.
$a,$b=$args;$a|% *ve $b 1

$args[1]|% *ve $args[0] 1

param($a,$b)$a|% *ve $b 1

calls .Remove on the string, using the number as an arg.

C (gcc) - 45 44 bytes
-1 Thanks to @Niel !
f(s,n)char*s;{for(;*s;++s)n--&&putchar(*s);}

alternative, 45 bytes :
g(s,n)char*s;{s[n++]=0;printf("%s%s",s,s+n);}

try it online

(s)ed - 6 bytes
1-based indexing.
s/.//n

Explanation:
s       # substitute command.
 /./    # match any single char.
   //   # substitution is empty.
     n  # Only match the 'n'th occurrence in a line.

Unfortunately, hardcoding part of the input into the program is not allowed. You'd have to get n from the user (STDIN, command-line arguments, etc.), which I'm not sure is possible in sed. There's always the option to wrap your solution in a Bash script though.

If you do sed s/.//$1 and call it a BASH + GNU utilities answer, I think it will be a good 11-byte answer and I'll change my downvote to an upvote :)

Yes the fun of being a newbie
I'll re-read the linked thread and try to do it all within sed.  I assumed that because all of the typed languages were sparse that it was preferred.
I know I can resort to ssed if it is going to be "GNU utilities" without a shell, not that I am anti GNU but the 'n' flag is a 4.4BSD feature IIRC.

Excel, 29 bytes
=LEFT(A1,A2)&MID(A1,A2+2,9^9)

Assumes input in cells A1 (string) and A2 (integer, 0-indexing).
Takes the left part of the string with LEFT and the right part - actually a substring starting on position A2+2 and 9^9 characters long (which is more then the max string length in one cell: 32,767 characters).

I think that you have miscounted your byte count. I see 29 bytes :)

@Taylor thanks, I must have had a trailing space when pasting into byte count tool.

R, 45 bytes
pryr::f(sub(paste0("(.{",n-1,"})."),"\\1",s))

couldn't you just use n instead of n-1 and say it's 0-indexed?
Also, just for fun you could use sprintf('(.{%d}).',n-1) instead of the paste0 expression and it would have the same length as your current answer.

SmileBASIC 3, 23 bytes
We have character indexing, why not use it? Set a character index to the empty string to delete it.
Defines a command A which prints the output. Uses 0-indexing.
DEF A S,N
S[N]="
?S
END

C, 57 50 bytes
#define f(s,n)for(i=n;s[i];i++)s[i]=s[i+1];puts(s)

0-indexed, naturally.  I call this macro with:
int main(int argc, char **argv)
{
    if (argc != 3)
        return;
    f(argv[1],atoi(argv[2]));
}

Could you shorten i<strlen(s); to s[i]? (I see you have done this in your shortC answer) Clever algorithm, btw.

@ETHproductions Oops, meant to put that in here. Thanks

Attache, 13 bytes
{_[0:#_^^_2]}

Try it online!
Explanation
{_[0:#_^^_2]}
{           }    anonymous lambda (_ = 1st argument, _2 = 2nd argument)
   0:#_          range from 0 to the length of _
       ^^_2      ...without the 2nd argument
 _[        ]     obtain characters from _ using that range

Lua, 51 38 bytes
Lowered to 38 bytes thanks to Jo King
x,y=...print(y:sub(1,x-1)..y:sub(x+1))

Try it online!
Just like everything else in Lua this is 1-indexed.
Explanation
Lua uses a table called arg to store arguments and the function sub() returns a substring of the string passed.
This is my first code golf entry, please be nice :)

You wrote wlse -- did you mean wise?

Welcome to PPCG! You can use ... to get this down to 38 bytes!

Rebol, Red - 12 bytes
 remove at s n

Hello and welcome to PPCG. I am unfamiliar with Rebol -- does your code reflect a full program or any function-esk construct? Snippets do not count as valid submissions to standard code golf challenges.

This does not appear to be valid - we require solutions to be either full programs or functions, unless stated otherwise. We don't allow the assumption that input is already in predefined variables. In order for this to be a valid function submission, it would need to be func [s n] [remove at s n] (assuming I'm reading the documentation correctly).

Runic, 48 bytes
   /~~{ R:1(?\~@
/3{\?)0:\S{-1/
\s3s}}1-U}:irui<

Try it online!
Not all test cases work at the moment: a few (more) flaws discovered in the parser.

Numbers are read as numerical values and don't unconcatenate (I need to call .ToString() on the popped object, then split the result into a char array; this will match intended spec of "doing operations to the best of the execution context's ability with the given stack values)
Spaces (and other white space) are input value separators (I need to readd the control character demarcation; got lost in the previous attempts to fix the next issue). After fixing inputs such as a != b would need to be passed as a\ !=\ b
Input needs a trailing newline (have not discovered a fix to this yet)

Other test cases work (and are considered 0-indexed).
Explanation

Program starts in the lower right (red), reads a string, unconcatenates it, reverse it (so the first character is at the top of the stack; behavior is so that u followed by q results in concatenation in the desired order, and q works the way it does because >'a'bq, >`ab`q, and >"ab" should all have the same result). Then the program reads the integer value and assumes (per question spec) that it is in the range [0,L), values above this range will simply loop (effective %). This value is duplicated and stored at the bottom of the stack for later.
The lower left portion (yellow) is the section responsible for shifting the string around on the stack N times, where N is the input value. The 3s3s portion rotates the top 2 items on the stack below the 3rd (which results in the front-most character in the string being rotated to the end without affecting the positions of the two counters with the next two } rotates). It exits this branch along the top (green), heading right and popping 2 values (the loop counter and then the character to discard) and rotating the saved input value back to the top.
The top right (blue) then loops the remaining characters back into place in reverse, exiting the loop (purple) towards the @ which discards the remaining loop counter and prints the stack top to bottom.
Picture has a mistake, along the bottom are some stack manipulators, }}}{ and in typing up this post I noticed that }{ cancels out and saves 3 bytes.

Factor, 10 bytes
remove-nth

Try it online!

Befunge-93, 26 bytes
&>1# -#,:#~_~~>:# 1#~+#,_@

Try it online!
1-indexed, does NOT require a null byte at the end of the string because that's lame. However, if you really want to get all "let's screw with the input format to make the code shorter", here is one that saves 3 bytes by assuming a null terminator:
&>1# -#,:#~_~~>:#~ #,_@

Braingolf, 38 37 bytes
VVR<lMMv.M2+-[R<vv]R$_v.?1-[R<v]|R&@;

Try it online!
0-based index
As always with Braingolf, the TIO link includes the entire Python3 parser. The code is the 2nd argument, the index is the 3rd argument, and the string is the 4th argument.

Retina, 29 bytes
1`\d+
$*
+`(	+)	(.)
$2$1
	.

Try it online!
The index and the string are on the same line separated by one tab. The index is zero-based.

Brain-Flak, 39 bytes
{({}<({}<>)<>>[()])}{}{}<>{({}<>)<>}<>

Try it online!
This has a one byte penalty for the -c flag which enables ASCII input and output. This takes the first parameter as a character code, which OP has allowed.
So the input is
0x01abcde

This uses zero indexing. Unfortunately, TIO doesn't allow null bytes in input, but this works locally so it's not an issue.

Swift - 86 bytes (0-indexed)
func l(s:String,n:Int){var a=s;a.remove(at:a.index(a.startIndex,offsetBy:n));print(a)}

Function that can be used as l(s:"abcdefg",n:3)
Check it out!

Swift - 120 bytes
Since I thought the above is quite boring, I came up with another solution:
func l(s:String,n:Int){let b=s.startIndex;print(s[b...s.index(b,offsetBy:n-1)]+s[s.index(b,offsetBy:n+1)..<s.endIndex])}

Works as the one below, it's just more interesting.

Perl 5, 19 bytes
18 bytes of code + -p flag
substr($_,<>,1)=""

Try it online!
substr($_,<>,1) returns 1 character at index <> (the 2nd input) in the string $_ (the input). And ="" changes it to "". And $_ is implicitely printed at the end thanks to -p flag.

Go, 50 bytes
1-indexed because we're all human, I think.
func f(s string,n int)string{return s[:n-1]+s[n:]}

Try it online!

Also note that the import statement is not being included because it is not being used in the function but rather for testing of it. Go requires an import to print stuff out.

Lua, 37 bytes
Uses 0 indexing
s,i=...
print(s:sub(1,i)..s:sub(i+2))

Try it online!

QBIC, 28 bytes
B=@ `+B?_t_s;,:|+_sB,a+2,_lB

This is an adaptation of my Substring Subtraction answer.
Explanation:
B=@ `+B     Prepend a space to the input string
?           PRINT
 _t           a trimmed version (drops the space again)
   _s         SUBSTRING
     ;,:|       Read B$ from cmd line, read n from cmd line
                SUBSTRING with a stirng and a positive N takes chars 1-N from the left.
   +_sB       Plus a second substring
     ,a+2       Starting behind the removee-index
     ,_lB       taking all the remaining characters

This could go all the way down to 22 bytes if I didn't need that hacky space prepended. Time to change Substring-behaviour for this use-case...
?_s;,:-1|+_sA,a+1,_lA

><>, 24 bytes
i:0(?v$1-:}?!~{
;?(3l<o{

Try it online, or at the fish playground
Takes the string as input from STDIN, and assumes the number for the index is already on the stack; outputs to STDOUT. It's 1-indexed.
The fish reads the string one character at a time, except it forgets the nth one after it reads it. It then prints the stack (in reverse) until there are only two (junk) things left.
Example: 4 and Boarfish becomes Boafish.

shortC, 36 bytes
Df(s,n)Oi=n;s[i];i++)s[i]=s[i+1];Js)

See my plain C answer for how to call the macro.

REXX 30 Bytes
parse arg p x
say delstr(x,p,1)

Batch, 56 bytes
@set/ps=
@set/ai=%1+1
@call echo %%s:~0,%1%%%%s:~%i%%%

Takes n 0-indexed as a command-line parameter and reads s from STDIN.

Braingolf, 23 bytes
VRMv.1-[R<v]R$_[R>v]R&@

Try it online!
Not at all golfy

Excel, 20 bytes
Different approach from previous Excel answer.
1-indexed n in A1.
Text in B1.
=REPLACE(B1,A1,1,"")

QBasic, 49 bytes
Uses 1-indexing.
INPUT n
LINE INPUT s$
?LEFT$(s$,n-1)+MID$(s$,n+1)

Reads a number and a string, and then prints the leftmost n-1 characters of the string plus everything from index n+1 to the end of the string.

Stacked, 17 bytes
{%y:0\#'..x-keep}

Try it online!
Explanation
{%y:0\#'..x-keep}    anonymous lambda, takes input on the stack
{%              }    parameters: x, y
  y:                 push y twice             [y, y]
    0\               push 0 beneath           [y, 0, y]
      #'             push size of TOS         [y, 0, size(y)]
        ..           range                    [y, range(0, size(y))]
          x-         subtract x from this     [y, range(0, size(y)) - x]
                     (thus x-x = 0)
            keep     keep respective chars    [the answer]
                     this removes the character at the `x`th index

MBASIC, 46 45 bytes
1 INPUT N,S$:PRINT LEFT$(S$,N-1);MID$(S$,N+1)

Just slamming substrings together, 1-indexed.
Output:
? 4,314151
31451

? 5,1234.5
12345

? 4,+-*/
+-*

? 3,a != b
a = b

? 2,abcde
acde

? 1,abcde
bcde

PHP, 43 Bytes
Try it online
run as pipe.
Code
<?=strtr(($s=$argv)[0],[$s[0][$s[1]]=>""]);

Explanation
<?=strtr(($s=$argv)[0],        # Set a shorter name for the $argv arguments var
          [$s[0][$s[1]]=>""]); # Replace for "" in the position

T-SQL, 28 bytes
SELECT STUFF(s,n,1,'')FROM t

Input is taken via a pre-existing table t with integer n and string s, per our IO standards.
I'm assuming n is 1-based, so I can pass it straight into the SQL Stuff function. STUFF inserts or replaces the characters at the given location, and in my case I'm replacing a single character with a blank.

><>, 9 bytes
i$:&?o&1-

Try it online!
Takes in the number via the -v flag and the string through STDIN. This is 0 indexed and ends with an error. You can add 5 bytes to avoid the error.
Explanation:
i           Get inputted character
 $          Swap and bring counter to the top
  :&        Store a copy in the register
    ?o      If the counter is not zero, print the character
      &1-   Restore and decrement the counter

Backhand, 12 bytes
{I>{{[ ~:oi_

Try it online!
Gets the inputted number followed by the string. 1 indexed.

05AB1E, 4 bytes
IõIǝ

Try it online or verify all test cases.
or alternatively
õŠŠǝ

Try it online or verify all test cases.
Explanation:
I       # Take the first string input
 õ      # Push an empty string
  I     # Take the second index-integer input
   ǝ    # Replace the character at the given index with the empty string

õ       # Push an empty string
 ŠŠ     # Triple-swap twice; a,b,c → c,a,b → b,c,a (implicitly using the two inputs)
        #  (`c` is the empty string here, `a` and `b` the input)
   ǝ    # Replace the character at the given index with the empty string

Forth (gforth), 45 bytes
: f tuck - 1- -rot 2dup type + 1+ swap type ;

Try it online!
0-indexed, n should be on top of the stack
Explanation
Prints the string up to the given character, then prints the remainder of the string after the given character
Code Explanation
\ since a lot of stack manipulation is happening, I will be including a listing of the
\ stack after each step. s = string address, g = length of string, n = char to remove
: f          \ starts a new word definition                                     | s g n
  tuck -     \ store a copy of n, then get the length of the end of the string  | s n g-n
  1-         \ subtract 1 from the length of the end ( to not output junk)      | s n g-n-1
  -rot       \ move the end-string length to the back of the stack              | g-n-1 s n
  2dup type  \ duplicate the address and length of the first output, then print | g-n-1 s n
  + 1+       \ get the starting address for the second output                   | g-n-1 s+n+1
  swap type  \ swap to get in proper order, then print                          |
;            \ end word definition                                              |

JavaScript 30 bytes
(n,[...s])=>(s[n]='',s.join``)

Try it online!

Tcl, 37 bytes
proc R n\ s {string repl $s $n $n ""}

Try it online!

Vyxal, 1 byte
⋎

Try it Online!
I don't know why I didn't use the built in

Thunno 2, 1 byte
Ɗ

Attempt This Online!
Built-in.


text:
Is this molecule polar?

Disclaimer
It is bad practice to draw out your molecules in 2 dimensions because that is not how they are. I chose to do this in 2D because it is easier to explain.
Note that the bond angles are wrong too: the angle in CH4 is 109.5°, not 90° as I said and the bond angle in NH4 is 107°. BHCl2 does have a bond angle of 120° and is 2D, however.

Challenge
Given the formula of a simple molecule as input, output a truthy value if the molecule is polar (asymmetrical) or a falsey value if the molecule is non-polar (symmetrical).
Determining Polarity
To determine whether a molecule is polar or not, we will have to look at its shape. For the purposes of this challenge, we will assume that molecules are 2D.
To demonstrate how to determine the polarity of a molecule, let us use three examples: methane (CH4), ammonia (NH3) and BHCl2.
CH4
Firstly, lets take the centre molecule, carbon. Carbon is in group four of the periodic table so it has four outer shell electrons, as shown below:

Now, we add the hydrogen atoms (each hydrogen atom supplies its own electron to make a pair):

Since there are no lone pairs of electrons, we can draw it with 90° between each bond since all bonds repel equally:

We can now see that methane is symmetrical so it is non-polar.
NH3
Like above, we take the centre molecule, nitrogen and draw out its outer shell electrons:

Adding the hydrogen atoms, we notice that there is a lone pair of electrons:

Since the lone pair is closer to the atom, it repels more than a bonding pair, so the angle between the bonds is smaller:

Evidently, NH3 is not symmetrical, so it is polar.
BHCl2
Taking boron as the centre molecule, we draw the three outer electrons:

We then add the hydrogen and the chlorines:

There are no lone pairs, so the bonds repel equally, forming an angle of 120°:

Although, the shape is symmetrical, the hydrogen atom makes the molecule asymmetrical, so BHCl2 is polar.
Rules
Built-ins which access molecule information are disallowed. You may access periodic table data using built-ins or without adding the file to your byte count. This data may be stored however you wish.
Input will only ever be a valid simple molecule: a single central atom (p-block element) which comes first in the formula and up to eight outer atoms (hydrogen, fluorine, chlorine, bromine, iodine, astatine) which only use single bonds.
You will never get a polyatomic ion or a molecule with co-ordinate (dative covalent) bonds as input. For example, with NH4, there would be a single unpaired electron, so the only for NH4 to form a stable molecule would be to lose the extra electron and become an ion (a polyatomic ion, since there is more than one atom in the ion).
If there are multiple lone pairs, they have to be spaced as far as possible from each other. For example, two lone pairs will have to be opposite from each other.
If there are non-polar and polar isomers of a molecule (e.g. SiF2Cl2) you should assume the molecule is non-polar.
Examples
Input -> Output
OH2 -> Falsey
CCl4 -> Falsey
OF4 -> Truthy
CH4 -> Falsey
NH3 -> Truthy
BHCl2 -> Truthy

Winning
Shortest code in bytes wins.

So, have I got the right idea if I say: we must return truthy if any of the counts of "outer" atoms does not divide the total number of outer atoms and otherwise return truthy iff the number of electrons for the "central" atom minus the total number of "outer" atoms divided by two is odd?

@Jonathan Yes, I think that's an easy way to work it out

actually I don't think "if any of the counts of "outer" atoms does not divide the total number of outer atoms" is right, for example OH2Cl4 (or Cl4H2O as it would normally be called) has 6 outer atoms, but the count of Cl, 4, does not divide 6.

The way you went from a hi-res diagram for Carbon, a lower-res diagram for Nitrogen and finally hand-written diagrams made me think about this Smurf joke :-p (In French, sorry, but you get the idea.)

I remember doing Lewis structures in Chem :(

Why is OF4 falsey? 6 valence electrons from O, 4 from F, total 10. As we are to consider 2D, this is pentagonal with 4 bonds and one lone pair. 2. Have you considered that XeF4Cl4 if it existed, would have 16 valence electrons!

can periodic table data (not counted as part of score) be given as a dictionary, string, or array? accessing a file can take a lot of bytes in some languages.

@LevelRiverSt Edited. Re. XeF4Cl4, it's the first example I came up with to demonstarate a molecule with polar and non-polar isomers

Water is polar...or is it just that with this algorithm it isn't?

@HyperNeutrino It's only non polar with this algorithm, since the lone pairs repel equally, making the water molecule symmetrical. However, in 3D reality it is polar.

@BetaDecay Ah okay. Makes sense, thanks.

Python 3, 296 bytes
import P,re,itertools
r="[A-Z][a-z]?"
f=re.findall(r,re.sub("(%s)(\d)"%r,lambda g:g.group(1)*int(g.group(2)),input()))
print(all(any(any(q[:len(q)//i]*i==q for i in range(2,len(q)))for q in[j[i:]+j[:i]for i in range(len(j))])<1for j in itertools.permutations(f+['e']*-(len(f)-P.a[f.pop(0)]>>1))))

Try it online!
-29 bytes thanks to ovs
Prints False or True.
This requires a dict of all p-block element symbols to the number of valence electrons they have. H is not necessary since it will only be one of the surrounding atoms. The dict is stored in P.py as a variable named a (it's written in the input for TIO and then placed into a Python file by the header)

303 bytes

296 bytes

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes