You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tool.go
    path of file: ./repos/video-srt-windows/app/aliyun
    
    the code of the file until where you have to start completion: package aliyun

import (
	"github.com/buger/jsonparser"
	"regexp"
	"s
    
func SubString(str string , begin int ,length int) (substr string) {
	// 将字符串的转换成[]rune
	rs := []rune(str)
	lth := len(rs)

	// 简单的越界判断
	if begin < 0 {
		begin = 0
	}
	if begin >= lth {
		begin = lth
	}
	if length < 0 {
		length = 0
	}
	end := begin + length
	if end > lth {
		end = lth
	}
	// 返回子串
	return string(rs[begin:end])
}