srttotext

package module
v0.0.0-...-f3d2068 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 3 Imported by: 0

README

srttotext

Go Utility for Extracting Plain Text from SRT Files

This Go code provides a utility to convert SRT content to plain text by removing timing and sequence number information. The Convert function takes SRT content as a string and returns the extracted textual content.

Example

func ExampleConvert() {
	// Sample SRT content
	input := `
1
00:00:01,000 --> 00:00:04,000
Hello, world!

2
00:00:05,000 --> 00:00:08,000
This is a test.
`

	output := Convert(input)
	fmt.Println(output)

	// Output:
	// Hello, world! This is a test.
}

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(srtContent string) string
Example
// Sample SRT content
input := `
1
00:00:01,000 --> 00:00:04,000
Hello, world!

2
00:00:05,000 --> 00:00:08,000
This is a test.
`

output := Convert(input)
fmt.Println(output)
Output:

Hello, world! This is a test.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL