My question points actually to a particular problem, as opposed to the more general type of problem suggested in the title -- which would nevertheless be interesting to me to see answered: I'd like to have the first line of text after a section (or chapter) heading set in small caps.
If this were about automating such a processing task for a given number of words starting after the sectional heading it would be an easy thing to do, but how could this be done for exactly an entire line of running text? Maybe with just a little better knowledge of TeX on my side I would not be making this question, but I don't know...
An answer on TeX, LateX2e or even LaTeX3 to the particular setting ("small caps") would be welcome and enough for my checking it (as long as it works, of course). And if there is some suggestion for the more general problem, that'd be simply wonderful: Let's say (just for the sake of concreteness and without pretending that what follows is a rigid spec) that "a given line" in the more general setting means "the line in which a particular string is to be found", and the "particular string" might be marked up in terms of some command. The processing, of a nature similar to the "small caps transformation" I'm concerned with in the particular setting, is to be applied to the entire line in which the string will eventually appear in the typeset document (i.e., once the processing has been performed).
PS: My tags for this question may not be the most fortunate, but they are the closest I could see among those provided.