Example #1
0
        public ByteArray /*!*/ replace([BytesConversion] IList <byte> /*!*/ old, [BytesConversion] IList <byte> /*!*/ new_, int maxsplit)
        {
            if (old == null)
            {
                throw PythonOps.TypeError("expected bytes or bytearray, got NoneType");
            }
            else if (maxsplit == 0)
            {
                return(CopyThis());
            }

            return(new ByteArray(_bytes.Replace(old, new_, maxsplit)));
        }