type TrimLeft<S extends string> = S extends `${Empty}${infer V}`? TrimLeft<V> : S
Solution by RanungPark #35509
type Empty = ' '| '\n' | '\t'
type TrimLeft<S extends string> = S extends `${Empty}${infer V}`? TrimLeft<V> : S
Solution by RanungPark #35480
type TrimLeft<S extends string> = S extends ` ${infer R}`
? TrimLeft<R>
: S extends `\n\t${infer R}`
? TrimLeft<R>
: S
Solution by eunsukimme #35135
type TrimLeft<S extends string> = S extends `${' ' | '\n' | '\t'}${infer R}` ? TrimLeft<R> : S;
Solution by raeyoung-kim #35029
// ์ฌ๊ธฐ ํ์ด๋ฅผ ์
๋ ฅํ์ธ์
type TrimLeft<S extends string> = S extends `${' ' | '\n' | '\t'}${infer R}` ? TrimLeft<R> : S;
Solution by LeeKangHyun #34914
We can separate string with literal templates.
type TrimLeft<S extends string> = S extends `${' ' | '\t' | '\n'}${infer R}` ? TrimLeft<R> : S;
Solution by dev-jaemin #34884
// your answers
type TrimLeft<S extends string> = S extends `${" " | "\n" | "\t"}${infer R}`
? TrimLeft<R>
: S;
Solution by zeyuanHong0 #34835
type TrimLeft<T extends string> = T extends `${' ' | '\n' | '\t'}${infer Rest}` ? TrimLeft<Rest> : T;
Solution by semet #34678
type TrimLeft<S extends string> = S extends `${' ' | '\n' | '\t'}${infer R}` ? TrimLeft<R> : S
Solution by binhdv155127 #34644
type Space = ' ' | '\n' | '\t'
type TrimLeft<S extends string> = S extends `${Space}${infer R}` ? TrimLeft<R> : S
Solution by devshinthant #34571
// ไฝ ็็ญๆก
type Space = ' ' | '\n' | '\t'
type TrimLeft = S extends ${Space}${infer B}
?TrimLeft:S
Solution by W-fitTiger #34258
type TrimLeft<S extends string> = S extends `${' '|'\n'|'\t'}${infer rest}` ? TrimLeft<rest> : S
Solution by ouzexi #33993
type TrimLeft<S extends string> = S extends `${' ' | '\n' | '\t'}${infer U}` ? TrimLeft<U> : S
Solution by ScriptBloom #33895
type Space = ' ' | '\n\t'
type TrimLeft<T extends string> = T extends `${Space}${infer R}` ? TrimLeft<R> : T
Solution by Danny101201 #33844
type TrimLeft<S extends string> = S extends `${' ' | '\n' | '\t'}${infer Rest}`
? TrimLeft<Rest>
: S
Solution by laplace1009 #33721
type Space = '\t' | '\n' | ' '
type TrimLeft<S extends string> = S extends `${Space}${infer word}` ? TrimLeft<word> : S
Solution by loevray #33326
// ไฝ ็็ญๆก
type WhiteType = ' '|'\n'|'\t'
type TrimLeft<S extends string> = S extends `${WhiteType}${infer O}` ? TrimLeft<O> : S
Solution by walker-hzx #32937
// ่งฃ็ญใใใใซ่จๅ
ฅ
type Space = ' '| '\n'|'\t';
type TrimLeft<S extends string> = S extends `${Space}${infer A}`
? TrimLeft<A>
: S;
ๅๅคๆฐS
ใในใใผในใฎๅพใซๆๅญๅใๆฅใฆใใใใฉใใใๅคๅฎใใในใใผในใใใใฐใTrimLeft
ใๅๅธฐๅฆ็ใงๅไฝใใใใ
\n
ใ\t
ใๅซใพใใใใใSpace
ใจใใใฆใใชใณๅใๅฎ็พฉใไฝฟ็จใใใSolution by Yasunori-aloha #32882
type Space = "\n" | " " | "\t"
type TrimLeft<S extends string> =S extends `${Space}${infer R}` ? TrimLeft<R>: S;
Solution by bananana0118 #32753
type Space = ' ' | '\n' | '\t'
type TrimLeft<T extends string> = T extends `${Space}${infer S}` ? TrimLeft<S> : T
Solution by ZhulinskiiDanil #32675
type TrimLeft<S extends string> = S extends `${' ' | '\n' | '\t'}${infer Rest}` ? TrimLeft<Rest> : S
Solution by dev-hobin #32364
type EmptyCharacter =
| ' '
| '\n'
| '\t'
type TrimLeft<TData extends string> = TData extends `${infer LeftPad}${infer Content}`
? LeftPad extends EmptyCharacter
? TrimLeft<Content>
: TData
: TData
Solution by LwveMike #32244
// your answers
type TrimLeft<S extends string> = S extends `${' ' | '\n' |'\t'}${infer R}` ? TrimLeft<R> : S;
Solution by pea-sys #31946
type Space = ' ' | '\n' |'\t'
type TrimLeft<S extends string> = S extends `${Space}${infer R}` ? TrimLeft<R> : S;
Solution by kai-phan #31625
// your answers
type TrimLeft<S extends string> = S extends `${' ' | '\n' | '\t'}${infer Text}` ? TrimLeft<Text> : S;
Solution by LcsGa #31611
type Space = '\t' | '\n' | ' ';
type TrimLeft<S extends string> = S extends `${Space}${infer R}` ? TrimLeft<R> : S;
Solution by jinyoung234 #31606
// your answers
type TrimLeft<T extends string> = T extends ` ${infer Text}` ? TrimLeft<Text> : T;
Solution by AhmedRagabKamal #31495
type TrimLeft<S extends string> = S extends `${infer R}${infer U}`
? R extends " " | "\n" | "\t"
? TrimLeft<U>
: `${R}${U}`
: "";
Solution by vipulpathak113 #31417
type H<T extends string> = `\n${T}`|`\t${T}`|` ${T}`
type TrimLeft<S extends string> = S extends H<infer A> ? TrimLeft<A> : S;
Solution by eward957 #31228
type Space = ' ' | '\n' | '\t'
type TrimLeft<S extends string> = S extends `${Space}${infer R}` ? TrimLeft<R> : S
Solution by MyeonghoonNam #30927