Skip to content
Discussion options

You must be logged in to vote

I'm not sure if you're asking about passing multiple string arguments or vector<String> type, so here're scenarios for both cases.

example module

module test::test {
    use std::string::String;
    use std::vector;
    struct Note has key {
        title: String,
        content: String,
    }

    public entry fun write_note(author: &signer, title: String, content: String) {
        let note = Note{ title, content };
        move_to(author, note);
    }

    public entry fun write_note_in_array(author: &signer, note: vector<String>) {
        let content = vector::pop_back(&mut note);
        let title = vector::pop_back(&mut note);
        let note = Note{ title, content };
        mov…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@0xbe1
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by kshitijc1506
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants