Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

String.StartsWith? #317

Open
jasonkuhrt opened this issue Sep 12, 2022 · 0 comments
Open

String.StartsWith? #317

jasonkuhrt opened this issue Sep 12, 2022 · 0 comments

Comments

@jasonkuhrt
Copy link

馃崺 Feature Request

Is your feature request related to a problem?

Need this type for working with string literals:

	export type StartsWith<Prefix extends string, S extends string> = 
		Prefix extends `${infer head1}${infer tail1}` ?
			S extends `${infer head2}${infer tail2}` ?
				head1 extends head2 ?
					StartsWith<tail1,tail2>
				: false
			: false
		: true

Something that could go into the library here?

Describe the solution you'd like

Describe alternatives you've considered

Teachability, Documentation, Adoption, Migration Strategy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant