zig-string icon indicating copy to clipboard operation
zig-string copied to clipboard

Include your Feature Requests Here!

Open JakubSzark opened this issue 5 years ago • 7 comments

Comment below for any features you would like to be added. Please add some example to make it easier to understand :)

JakubSzark avatar Sep 04 '20 02:09 JakubSzark

I would like to have a concatvar var x:[] u8 please you worked well

AS400JPLPC avatar Oct 03 '22 12:10 AS400JPLPC

An implementation of format() to allow for the String to be written to a writer. I was thinking as simple as this.

pub fn format(
    self: *const String,
    comptime _: []const u8,
    _: std.fmt.FormatOptions,
    writer: anytype
) std.os.WriteError!void {
    if (self.buffer) | buffer | {
        return writer.print("{s}", .{buffer[0..self.size]});
    }
}

If need be the format options can be tapped into and the resulting print being formatted according to the options

Tired-Fox avatar Jun 19 '23 21:06 Tired-Fox

Could you please update the time complexity column? It doesn't make sense to say f(n) is at best O(g(n)), as Big-O notation tells us upper bound already, at best tells us about lower bound, so the sentence 'f(n) is at best O(g(n))' basically says nothing.

Or am I getting wrong the meaning of "best"? Either way best case big-O is confusing.

I guess it will make more sense to list a lower-bound with big-omega, upper-bound with big-o, and amortized time complexity with big-theta.

glyh avatar Aug 23 '23 02:08 glyh

Just removed that column since its kind of pointless. I doubt myself when I use Big-O all the time haha.

JakubSzark avatar Aug 23 '23 03:08 JakubSzark

I'd like a string replacement function!

Reference C code: https://stackoverflow.com/questions/779875/what-function-is-to-replace-a-substring-from-a-string-in-c

limdingwen avatar Jan 15 '24 11:01 limdingwen