Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for ReplaceAll (0.15 sec)

  1. src/cmd/asm/internal/lex/lex.go

    }
    
    // Make returns a Token with the given rune (ScanToken) and text representation.
    func Make(token ScanToken, text string) Token {
    	// Substitute the substitutes for . and /.
    	text = strings.ReplaceAll(text, "\u00B7", ".")
    	text = strings.ReplaceAll(text, "\u2215", "/")
    	return Token{ScanToken: token, text: text}
    }
    
    func (l Token) String() string {
    	return l.text
    }
    
    // A Macro represents the definition of a #defined macro.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Aug 29 18:31:05 GMT 2023
    - 4.1K bytes
    - Viewed (0)
  2. src/bytes/example_test.go

    	fmt.Printf("%s\n", bytes.Replace([]byte("oink oink oink"), []byte("oink"), []byte("moo"), -1))
    	// Output:
    	// oinky oinky oink
    	// moo moo moo
    }
    
    func ExampleReplaceAll() {
    	fmt.Printf("%s\n", bytes.ReplaceAll([]byte("oink oink oink"), []byte("oink"), []byte("moo")))
    	// Output:
    	// moo moo moo
    }
    
    func ExampleRunes() {
    	rs := bytes.Runes([]byte("go gopher"))
    	for _, r := range rs {
    		fmt.Printf("%#U\n", r)
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  3. src/bytes/bytes.go

    	}
    	w += copy(t[w:], s[start:])
    	return t[0:w]
    }
    
    // ReplaceAll returns a copy of the slice s with all
    // non-overlapping instances of old replaced by new.
    // If old is empty, it matches at the beginning of the slice
    // and after each UTF-8 sequence, yielding up to k+1 replacements
    // for a k-rune slice.
    func ReplaceAll(s, old, new []byte) []byte {
    	return Replace(s, old, new, -1)
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  4. src/archive/zip/reader.go

    func (f *fileListEntry) String() string {
    	return fs.FormatDirEntry(f)
    }
    
    // toValidName coerces name to be a valid name for fs.FS.Open.
    func toValidName(name string) string {
    	name = strings.ReplaceAll(name, `\`, `/`)
    	p := path.Clean(name)
    
    	p = strings.TrimPrefix(p, "/")
    
    	for strings.HasPrefix(p, "../") {
    		p = p[len("../"):]
    	}
    
    	return p
    }
    
    func (r *Reader) initFileList() {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 27.7K bytes
    - Viewed (0)
  5. src/bytes/bytes_test.go

    			t.Errorf("Replace(%q, %q, %q, %d) didn't copy", tt.in, tt.old, tt.new, tt.n)
    		}
    		if tt.n == -1 {
    			out := ReplaceAll(in, []byte(tt.old), []byte(tt.new))
    			if s := string(out); s != tt.out {
    				t.Errorf("ReplaceAll(%q, %q, %q) = %q, want %q", tt.in, tt.old, tt.new, s, tt.out)
    			}
    		}
    	}
    }
    
    type TitleTest struct {
    	in, out string
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Jan 24 16:07:25 GMT 2024
    - 56.2K bytes
    - Viewed (0)
Back to top